[keycloak-dev] Exception handling for own REST API - is it possible to register own javax.ws.rs.ext.ExceptionMapper?
Stian Thorgersen
sthorger at redhat.com
Mon Jun 13 02:56:30 EDT 2016
Providers would also need to be registered in KeycloakApplication. We don't
support that at the moment at least. You could add try/catch to your code
and return an extension of WebApplicationException [1]. That way you can
define how the response should look like.
[1]
https://github.com/keycloak/keycloak/blob/master/services/src/main/java/org/keycloak/services/ErrorResponseException.java
On 9 June 2016 at 12:42, Vlastimil Elias <velias at redhat.com> wrote:
> Hi,
>
> I'm implementing my own REST endpoint using RealmResourceProvider and I'm
> thinking how to perform error handling (which is not covered in example).
> Is it possible to register my javax.ws.rs.ext.ExceptionMapper subclass to
> handle my exceptions? I tried to add subclass of it annotated with
> javax.ws.rs.ext.Provider into my code but it is not used.
> I get common error page with:
>
> *Stack Trace*
> org.jboss.resteasy.spi.UnhandledException:
> com.redhat.developer.keycloak.rest.InvalidParametersException: email param
> must be specified
>
> Thansk in advance.
>
> Vlastimil
>
> --
> Vlastimil Elias
> Principal Software Engineer
> Red Hat Developer | Engineering
>
>
> _______________________________________________
> keycloak-dev mailing list
> keycloak-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/keycloak-dev/attachments/20160613/c30bc527/attachment.html
More information about the keycloak-dev
mailing list