com.atlassian.jira.rest.exception
Class ExceptionInterceptor
java.lang.Object
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
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 |
ExceptionInterceptor
public ExceptionInterceptor(I18nHelper i18n)
- Creates a new ExceptionInterceptor.
- Parameters:
i18n
- a I18nHelper
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-2012 Atlassian. All Rights Reserved.