com.atlassian.jira.rest.exception
Class ExceptionInterceptor

java.lang.Object
  extended by com.atlassian.jira.rest.exception.ExceptionInterceptor
All Implemented Interfaces:
com.atlassian.plugins.rest.common.interceptor.ResourceInterceptor

public class ExceptionInterceptor
extends Object
implements com.atlassian.plugins.rest.common.interceptor.ResourceInterceptor

This interceptor creates responses for any exceptions thrown from a resource method.

When creating a response, the client's Accept header is matched to the resource's Produces annotations and the first matching media type is used.

See JRADEV-2862 and JRADEV-3240.

Since:
v4.2

Constructor Summary
ExceptionInterceptor(ContextI18n i18n)
          Creates a new ExceptionInterceptor.
 
Method Summary
 void intercept(com.atlassian.plugins.rest.common.interceptor.MethodInvocation invocation)
          Intercepts the method invocation, setting the media type correctly in case of an exception.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExceptionInterceptor

public ExceptionInterceptor(ContextI18n i18n)
Creates a new ExceptionInterceptor.

Parameters:
i18n - a ContextI18n
Method Detail

intercept

public void intercept(com.atlassian.plugins.rest.common.interceptor.MethodInvocation invocation)
               throws IllegalAccessException,
                      InvocationTargetException
Intercepts the method invocation, setting the media type correctly in case of an exception.

Specified by:
intercept in interface com.atlassian.plugins.rest.common.interceptor.ResourceInterceptor
Parameters:
invocation - Context information about the invocation
Throws:
IllegalAccessException
InvocationTargetException


Copyright © 2002-2013 Atlassian. All Rights Reserved.