public class

ExceptionInterceptor

extends Object
implements ResourceInterceptor
java.lang.Object
   ↳ com.atlassian.jira.rest.exception.ExceptionInterceptor

Class Overview

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 javax.ws.rs.Produces annotations and the first matching media type is used.

See JRADEV-2862 and JRADEV-3240.

Summary

Public Constructors
ExceptionInterceptor(I18nHelper i18n)
Creates a new ExceptionInterceptor.
Public Methods
void intercept(MethodInvocation invocation)
Intercepts the method invocation, setting the media type correctly in case of an exception.
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.plugins.rest.common.interceptor.ResourceInterceptor

Public Constructors

public ExceptionInterceptor (I18nHelper i18n)

Creates a new ExceptionInterceptor.

Parameters
i18n a I18nHelper

Public Methods

public void intercept (MethodInvocation invocation)

Intercepts the method invocation, setting the media type correctly in case of an exception.

Parameters
invocation Context information about the invocation