Interface ExceptionMapper<E extends java.lang.Throwable>

public interface ExceptionMapper<E extends java.lang.Throwable>

Contract for a provider that maps Java exceptions to Response. An implementation of this interface must be annotated with Provider.

See Also:
Provider, Response

Method Summary
 Response toResponse(E exception)
          Map an exception to a Response.

Method Detail


Response toResponse(E exception)
Map an exception to a Response. Returning null results in a Response.Status.NO_CONTENT response. Throwing a runtime exception results in a Response.Status.INTERNAL_SERVER_ERROR response

exception - the exception to map to a response
a response mapped from the supplied exception

Submit a bug or feature

Copyright © 2009-2011, Oracle Corporation and/or its affiliates. All Rights Reserved. Use is subject to license terms.

Generated on 10-February-2011 12:41

Scripting on this page tracks web page traffic, but does not change the content in any way.