From 21823a35c0113d36719e24045dea69378ac57bb2 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 29 May 2025 00:20:29 +0000 Subject: [PATCH] xhc_mset: improve error message formatting We don't need extra linefeeds before the `)' in the stderr output, and the context from croak() is bogus anyways since we get error messages from an external process. --- lib/PublicInbox/XhcMset.pm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/PublicInbox/XhcMset.pm b/lib/PublicInbox/XhcMset.pm index d6dc877f9..fd359d091 100644 --- a/lib/PublicInbox/XhcMset.pm +++ b/lib/PublicInbox/XhcMset.pm @@ -10,7 +10,6 @@ use PublicInbox::IO qw(read_all); use PublicInbox::XhcMsetIterator; use PublicInbox::Syscall qw(EPOLLIN EPOLLONESHOT); use Fcntl qw(SEEK_SET); -use Carp qw(croak); use PublicInbox::Git qw(git_quote); sub die_err ($@) { @@ -19,7 +18,7 @@ sub die_err ($@) { seek $err_rw, 0, SEEK_SET; my $s = read_all $err_rw; chomp $s; - croak $s, @msg; + die $s, @msg, "\n"; } sub event_step { @@ -41,7 +40,7 @@ sub event_step { scalar(@it) == $size or die_err $self, 'got ', scalar(@it), ', expected mset.size=', $size; }; - my $err = $@; + chomp(my $err = $@); $self->close; eval { $cb->(@args, $self, $err) }; warn "E: $@\n" if $@; -- 2.47.3