From 6bb8478c8dacf83492de3afe15a615d646f0904f Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 13 Oct 2021 07:00:35 +0000 Subject: lei: use standard warn() in more places warn() is easier to augment with context information, and frankly unavoidable in the presence of 3rd-party libraries we don't control. --- lib/PublicInbox/LeiMirror.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/PublicInbox/LeiMirror.pm') diff --git a/lib/PublicInbox/LeiMirror.pm b/lib/PublicInbox/LeiMirror.pm index 4be8f70a..ec41bec6 100644 --- a/lib/PublicInbox/LeiMirror.pm +++ b/lib/PublicInbox/LeiMirror.pm @@ -20,7 +20,7 @@ sub _wq_done_wait { # dwaitpid callback (via wq_eof) if ($?) { $lei->child_error($?); } elsif (!unlink($f)) { - $lei->err("unlink($f): $!") unless $!{ENOENT}; + warn("unlink($f): $!\n") unless $!{ENOENT}; } else { if ($lei->{cmd} ne 'public-inbox-clone') { $lei->lazy_cb('add-external', '_finish_' @@ -120,7 +120,7 @@ sub _try_config { -d $dst or die "mkpath($dst): $!\n"; } my $err = _get_txt($self, qw(_/text/config/raw inbox.config.example)); - return $self->{lei}->err($err) if $err; + return warn($err, "\n") if $err; my $f = "$self->{dst}/inbox.config.example"; chmod((stat($f))[2] & 0444, $f) or die "chmod(a-w, $f): $!"; my $cfg = PublicInbox::Config->git_config_dump($f, $self->{lei}->{2}); @@ -151,7 +151,7 @@ sub index_cloned_inbox { my ($self, $iv) = @_; my $lei = $self->{lei}; my $err = _get_txt($self, qw(description description)); - $lei->err($err) if $err; # non fatal + warn($err, "\n") if $err; # non fatal eval { set_description($self) }; warn $@ if $@; @@ -380,7 +380,7 @@ sub try_manifest { my ($path_pfx, $v1_path, @v2_epochs) = deduce_epochs($m, $path); if (@v2_epochs) { # It may be possible to have v1 + v2 in parallel someday: - $lei->err(<