]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LeiInput.pm
www_stream: note existence of IMAP and NNTP URLs
[public-inbox.git] / lib / PublicInbox / LeiInput.pm
index 1b28f36f68c57136c90823d0abf0004bab5fc2bc..8ce445c80d07b3748c8828e63f1d55db8aefb28d 100644 (file)
@@ -63,7 +63,7 @@ sub input_fh {
        my ($self, $ifmt, $fh, $name, @args) = @_;
        if ($ifmt eq 'eml') {
                my $buf = do { local $/; <$fh> } //
-                       return $self->{lei}->child_error(1 << 8, <<"");
+                       return $self->{lei}->child_error(0, <<"");
 error reading $name: $!
 
                # mutt pipes single RFC822 messages with a "From " line,
@@ -104,7 +104,7 @@ sub handle_http_input ($$@) {
        my $err = $@;
        waitpid($pid, 0);
        $? || $err and
-               $lei->child_error($? || 1, "@$cmd failed".$err ? " $err" : '');
+               $lei->child_error($?, "@$cmd failed".$err ? " $err" : '');
 }
 
 sub input_path_url {
@@ -276,7 +276,10 @@ sub prepare_inputs { # returns undef on error
                                $may_sync and $input = 'maildir:'.
                                                $lei->abs_path($input_path);
                        } else {
-                               return $lei->fail("Unable to handle $input");
+                               my $m = "Unable to handle $input";
+                               $input =~ /\A(?:L|kw):/ and
+                                       $m .= ", did you mean +$input?";
+                               return $lei->fail($m);
                        }
                } elsif ($input =~ /\.(?:eml|patch)\z/i && -f $input) {
                        lc($in_fmt//'eml') eq 'eml' or return $lei->fail(<<"");