[
https://issues.apache.org/jira/browse/MIME4J-77?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12644535#action_12644535
]
Markus Wiederkehr commented on MIME4J-77:
-----------------------------------------
@Robert:
You are using one Java class (IOException in this case) for two completely
unrelated classes of errors that can occur when loading a message: true I/O
errors and parsing errors in case of malformed messages. This invites the user
to be sloppy with the error handling. Or worse, the user may not even become
aware of the fact that there are two classes of errors if he/she does not study
the API carefully enough.
Using only one exception and a subclass instead of two independent exceptions
is a bit unconventional, you said so yourself. It is certainly not what I would
expect, but I can live with it.
If you decide to stick to this decision Oleg's patch is a good compromise
because it eliminates the is-a relationship between MimeException and
IOException by introducing a third class MimeIOException that serves as an
adapter.
@Oleg:
Please include a getter in MimeIOException to retrieve the underlying
MimeException without having to cast.
I think you should also declare "throws MimeIOException, IOException" where
appropriate (Header and Message). This has the advantage that an IDE like
Eclipse can create a catch block for MimeIOException automatically.
Also your patch does not seem to cover MaxLineLimitException.
> Decide Whether MimeException should extend IOException
> ------------------------------------------------------
>
> Key: MIME4J-77
> URL: https://issues.apache.org/jira/browse/MIME4J-77
> Project: JAMES Mime4j
> Issue Type: Task
> Affects Versions: 0.4
> Reporter: Robert Burrell Donkin
> Fix For: 0.6
>
> Attachments: mimeex.patch
>
>
> Decide whether MimeException should extend IOException
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]