[ 
https://issues.apache.org/jira/browse/MIME4J-280?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16493857#comment-16493857
 ] 

ASF GitHub Bot commented on MIME4J-280:
---------------------------------------

GitHub user dmak opened a pull request:

    https://github.com/apache/james-mime4j/pull/20

    MIME4J-280 Wrapping the underlying exception rather then ignoring it.

    

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/dmak/james-mime4j MIME4J-280

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/james-mime4j/pull/20.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #20
    
----
commit c0513d9c83966fa68d3101a85cfa4e7db43ccc1b
Author: Dmitry Katsubo <dmitry.katsubo@...>
Date:   2018-05-23T10:25:03Z

    MIME4J-280 Wrapping the underlying exception rather then ignoring it.

----


> Exception stack trace should include the underlying parser exception
> --------------------------------------------------------------------
>
>                 Key: MIME4J-280
>                 URL: https://issues.apache.org/jira/browse/MIME4J-280
>             Project: James Mime4j
>          Issue Type: Improvement
>          Components: dom
>    Affects Versions: 0.7.2
>            Reporter: Dmitry Katsubo
>            Priority: Trivial
>
> I think this is beneficial to be able to trace the exception back to JJTree 
> parser, in particular I suggest to wrap {{TokenMgrError}} in corresponding 
> places e.g. in the way it is shown in the following patch:
> {code}
> --- 
> a/dom/src/main/jjtree/org/apache/james/mime4j/field/address/AddressListParser.jjt
> +++ 
> b/dom/src/main/jjtree/org/apache/james/mime4j/field/address/AddressListParser.jjt
> @@ -77,7 +77,7 @@
>              parseAddressList0();
>              return (ASTaddress_list) jjtree.rootNode();
>          } catch (TokenMgrError tme) {
> -            throw new ParseException(tme.getMessage());
> +            throw new ParseException(tme);
>          }
>      }
>  
> @@ -86,7 +86,7 @@
>              parseAddress0();
>              return (ASTaddress) jjtree.rootNode();
>          } catch (TokenMgrError tme) {
> -            throw new ParseException(tme.getMessage());
> +            throw new ParseException(tme);
>          }
>      }
>  
> @@ -95,7 +95,7 @@
>              parseMailbox0();
>              return (ASTmailbox) jjtree.rootNode();
>          } catch (TokenMgrError tme) {
> -            throw new ParseException(tme.getMessage());
> +            throw new ParseException(tme);
>          }
>      }
>  
> {code}
> If the community finds it useful, I can contribute to that.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to