Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

117 nicer conversion error message #118

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

bufordrat
Copy link
Contributor

@bufordrat bufordrat commented Jan 28, 2025

Fixes #117.

With this branch, Attachment Converter now emits error messages to stderr in ANVL format. When OCamlnet is the backend and there is an email parse error, there is an additional field for the email parse error message (Mr. Mime does not provide parse error messages).

There are two kinds of error message:

  • an email parse error
  • an error thrown by a conversion utility while trying to convert an attachment

Here is what they look like with OCamlnet as a backend:

Error-Type: attachment skipped; conversion pdftotext-pdf-to-txt exited with status 1 and error output:
  Command Line Error: Incorrect password
  cat: /tmp/tmp.wqxrFkz7DQ/temp-out.txt: No such file or directory
Date: Mon, 1 Feb 2016 23:12:28 +0000
From: Sender <[email protected]>
Message-ID: <9999999.20160201231228.a5afe65d7d2ded.15719695@mail133-8.atl131.messageid.net>
Filename: document.pdf

Error-Type: email skipped; email parse error
Backend: OCamlnet
Date: Tue, 26 May 2015 18:52:34 +0000
From: "[email protected]" <[email protected]>
Message-ID: <message-id-username@anonymous>
Error-Message: Netmime.read_mime_message: missing boundary parameter

Here is what they look like with Mr. Mime as a backend:

Error-Type: attachment skipped; conversion pdftotext-pdf-to-txt exited with status 1 and error output:
  Command Line Error: Incorrect password
  cat: /tmp/tmp.rIayCk33Dr/temp-out.txt: No such file or directory
Date: Mon, 1 Feb 2016 23:12:28 +0000
From: Sender <[email protected]>
Message-ID: <30379028.20190201131213.aaafe65cae2de3.15719695@mail133-8.atl131.messageid.net>
Filename: document.pdf

Error-Type: email skipped; email parse error
Backend: Mr. Mime
Date: Wed, 20 Jan 2016 16:52:42 +0000
From: Jacqui McShee <[email protected]>
Message-ID: <0F81959B7973CB47A4C7CE2A90BEE89D5EF41AF5@message-id>

@bufordrat bufordrat requested a review from nmmull January 28, 2025 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

nicer conversion error message
1 participant