james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <server-...@james.apache.org>
Subject [jira] [Commented] (JAMES-2275) Allow per Exception error handling in the mailet pipeline
Date Tue, 09 Jan 2018 02:40:00 GMT

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

ASF GitHub Bot commented on JAMES-2275:
---------------------------------------

GitHub user apptaro opened a pull request:

    https://github.com/apache/james-project/pull/96

    JAMES-2275 Exception Error Handling Feature

    

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

    $ git pull https://github.com/apptaro/james-project JAMES-2275

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

    https://github.com/apache/james-project/pull/96.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 #96
    
----
commit a2d1973e19e72ef9fd552d5c715d7e993c1dfcc4
Author: apptaro <apptaro@...>
Date:   2018-01-05T07:54:08Z

    Merge remote-tracking branch 'refs/remotes/apache/master'

commit 2d7f435b7c02e241b16cd0f14f005f63269991aa
Author: apptaro <apptaro@...>
Date:   2018-01-09T02:37:45Z

    JAMES-2275 Added Exception Error Handling Functionality

----


> Allow per Exception error handling in the mailet pipeline
> ---------------------------------------------------------
>
>                 Key: JAMES-2275
>                 URL: https://issues.apache.org/jira/browse/JAMES-2275
>             Project: James Server
>          Issue Type: New Feature
>          Components: Mailet Contributions
>    Affects Versions: master
>            Reporter: Tellier Benoit
>              Labels: easy-fix, feature, newbie
>
> In JAMES-2271 from [~apptaro], the error handling system of the mailet pipeline can now
be customized using the *onMailetException* property. This allows specifying the processor
for error handling or ignore the error (by default error processor is triggered).
> While empowering the user to write custom error handling logic, the error handling code
capabilities is limited as the original exception is lost along the way.
> We should:
>  - Pass the Exception along with the Mail, as an attribute. 
> Thus mailet in the error processor can access and read it. Throwable being serializable,
this makes this change easy to perform.
>  - Implement specific error handling matchers:
>    - *HasException* would allow to see if a Mail has a specific exception
> {code:xml}
> <mailet match="HasException=org.apache.james.managesieve.api.ManageSieveException"
class="...>
>     ....
> </mailet>
> {code}
> ### How to implement this
> 1. Add a ERROR_ATTRIBUTE_NAME contant in the Mail interface
> 2. ProcessorUtil:: handleException should add the ERROR_ATTRIBUTE_NAME attriute using
the provided exception
> 3. Modify *AbstractStateMailetProcessorTest* to demonstrate that when a mailet or a matcher
throws, the Exception is attahed to the incoming mail.
> 4. In the mailet/standard project, you will implement the HasException matcher. You can
extend GenericMatcher and implement unit tests for your class.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message