about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiMirror.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-10-13 07:00:35 +0000
committerEric Wong <e@80x24.org>2021-10-13 19:51:18 +0000
commit6bb8478c8dacf83492de3afe15a615d646f0904f (patch)
tree0e1aaf64816b118f4890509b86caf043e4c7fa7c /lib/PublicInbox/LeiMirror.pm
parent759493eb1eb737e9dedd30b8280bc4067077c615 (diff)
downloadpublic-inbox-6bb8478c8dacf83492de3afe15a615d646f0904f.tar.gz
warn() is easier to augment with context information, and
frankly unavoidable in the presence of 3rd-party libraries
we don't control.
Diffstat (limited to 'lib/PublicInbox/LeiMirror.pm')
-rw-r--r--lib/PublicInbox/LeiMirror.pm8
1 files changed, 4 insertions, 4 deletions
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(<<EOM) if defined $v1_path;
+                warn(<<EOM) if defined $v1_path;
 # `$v1_path' appears to be a v1 inbox while v2 epochs exist:
 # @v2_epochs
 # ignoring $v1_path (use --inbox-version=1 to force v1 instead)