Skip to content
Discussion options

You must be logged in to vote

Thanks, that also works. I was mostly wondering about the general approach though, in my application I'm passing one of the parameters to another service, so don't know whether it's an invalid parameter until part way through the method execution.

I solved it in the end by creating a mapper for the exception instead:

    @ServerExceptionMapper
    public RestResponse<String> mapException(BadRequestException e) {
        return RestResponse.status(RestResponse.Status.BAD_REQUEST, e.getMessage());
    }

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@davechallis
Comment options

Answer selected by davechallis
@geoand
Comment options

geoand Oct 9, 2023
Collaborator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
4 participants