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

Exception Mapper #255

Closed
obigard opened this Issue Jul 2, 2014 · 1 comment

Comments

Projects
None yet
2 participants
@obigard

obigard commented Jul 2, 2014

Hi,

I'm searching if there is a way in Wisdom to map exceptions like in Jersey (https://jersey.java.net/documentation/latest/user-guide.html#d0e5171)...

Currently, the only way I found to do such things in Wisdom is creating a Filter like this:


public Result call(Route route, RequestContext rc) throws Exception
{
        Result res;
        
        try
        {
            res = rc.proceed();
        }
        catch (Exception e)
        {
            res = Results.internalServerError(e.getCause().getMessage());
        }
        
        return res;
    }

So I can manage different exception types in the "catch" block.

The bad thing here is that I'm filtering ALL the calls, even if only the calls that generate Exceptions are interesting me (performance issue?)...

Thanks,
Olivier

@cescoffier

This comment has been minimized.

Show comment
Hide comment
@cescoffier

cescoffier Jul 2, 2014

Member

I agree that it would be more elegant to introduce such concept in the DefaultErrorHandler.

Member

cescoffier commented Jul 2, 2014

I agree that it would be more elegant to introduce such concept in the DefaultErrorHandler.

@cescoffier cescoffier added this to the 0.7 milestone Jul 2, 2014

cescoffier added a commit that referenced this issue Jul 2, 2014

Initial work on #255
Tests and documentation are missing.

Signed-off-by: Clement Escoffier <clement.escoffier@gmail.com>

@cescoffier cescoffier closed this in 45de180 Jul 3, 2014

cescoffier added a commit that referenced this issue Jul 3, 2014

Add documentation about #255
Signed-off-by: Clement Escoffier <clement.escoffier@gmail.com>

@cescoffier cescoffier modified the milestones: 0.6.1, 0.7 Jul 3, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment