Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * The contents of this file are subject to the terms
  * of the Common Development and Distribution License
  * (the "License").  You may not use this file except
  * in compliance with the License.
  *
  * You can obtain a copy of the license at
  * http://www.opensource.org/licenses/cddl1.php
  * See the License for the specific language governing
 * permissions and limitations under the License.
 */
package javax.ws.rs.ext;
Contract for a provider that maps Java exceptions to javax.ws.rs.core.Response. An implementation of this interface must be annotated with Provider.

public interface ExceptionMapper<E extends Throwable> {

    
Map an exception to a javax.ws.rs.core.Response. Returning null results in a javax.ws.rs.core.Response.Status.NO_CONTENT response. Throwing a runtime exception results in a javax.ws.rs.core.Response.Status.INTERNAL_SERVER_ERROR response

Parameters:
exception the exception to map to a response
Returns:
a response mapped from the supplied exception
    Response toResponse(E exception);
New to GrepCode? Check out our FAQ X