* [PATCH] lei: use ->child_error API properly
@ 2023-12-16 11:06 Eric Wong
0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2023-12-16 11:06 UTC (permalink / raw)
To: spew
---
lib/PublicInbox/LeiExportKw.pm | 4 ++--
lib/PublicInbox/LeiMirror.pm | 2 +-
lib/PublicInbox/LeiToMail.pm | 4 ++--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/lib/PublicInbox/LeiExportKw.pm b/lib/PublicInbox/LeiExportKw.pm
index d2396fa7..16f069da 100644
--- a/lib/PublicInbox/LeiExportKw.pm
+++ b/lib/PublicInbox/LeiExportKw.pm
@@ -38,7 +38,7 @@ sub export_kw_md { # LeiMailSync->each_src callback
} elsif ($! == EEXIST) { # lost race with lei/store?
return;
} elsif ($! != ENOENT) {
- $lei->child_error(1,
+ $lei->child_error(0,
"E: rename_noreplace($src -> $dst): $!");
} # else loop @try
}
@@ -46,7 +46,7 @@ sub export_kw_md { # LeiMailSync->each_src callback
# both tries failed
my $oidhex = unpack('H*', $oidbin);
my $src = "$mdir/{".join(',', @try)."}/$$id";
- $lei->child_error(1, "rename_noreplace($src -> $dst) ($oidhex): $e");
+ $lei->child_error(0, "rename_noreplace($src -> $dst) ($oidhex): $e");
for (@try) { return if -e "$mdir/$_/$$id" }
$self->{lms}->clear_src("maildir:$mdir", $id);
}
diff --git a/lib/PublicInbox/LeiMirror.pm b/lib/PublicInbox/LeiMirror.pm
index e048a807..6fbb99d1 100644
--- a/lib/PublicInbox/LeiMirror.pm
+++ b/lib/PublicInbox/LeiMirror.pm
@@ -1174,7 +1174,7 @@ sub try_manifest {
local $self->{-local_manifest} = load_current_manifest($self);
local $self->{-new_symlinks} = [];
my ($path_pfx, $n, $multi) = multi_inbox($self, \$path, $m);
- return $lei->child_error(1, $multi) if !ref($multi);
+ return $lei->child_error(0, $multi) if !ref($multi);
my $v2 = delete $multi->{v2};
if ($v2) {
for my $name (sort keys %$v2) {
diff --git a/lib/PublicInbox/LeiToMail.pm b/lib/PublicInbox/LeiToMail.pm
index 514cf7ff..de75e99e 100644
--- a/lib/PublicInbox/LeiToMail.pm
+++ b/lib/PublicInbox/LeiToMail.pm
@@ -147,9 +147,9 @@ sub git_to_mail { # git->cat_async callback
$type = 'blob';
$size = length($$bref);
}
- $type eq 'blob' or return $self->{lei}->child_error(1,
+ $type eq 'blob' or return $self->{lei}->child_error(0,
"W: $oid is $type (!= blob)");
- $size or return $self->{lei}->child_error(1,"E: $oid is empty");
+ $size or return $self->{lei}->child_error(0,"E: $oid is empty");
$smsg->{blob} eq $oid or die "BUG: expected=$smsg->{blob}";
$self->{wcb}->($bref, $smsg);
};
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2023-12-16 11:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-16 11:06 [PATCH] lei: use ->child_error API properly Eric Wong
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).