public interface

UnhandledExceptionMapperHelper

com.atlassian.bitbucket.rest.exception.UnhandledExceptionMapperHelper

Class Overview

Provides standard mappings for exceptions.

Plugin developers who are exposing REST endpoints should include a subclass of UnhandledExceptionMapper and <component-import/> this interface to pass through to its constructor. The combination of the derived class and the import give plugin developer REST endpoints all the same exception mapping done for built- in REST endpoints.

Summary

Public Methods
@Nonnull Response map(Exception exception)
Maps the provided Exception to a REST Response.

Public Methods

@Nonnull public Response map (Exception exception)

Maps the provided Exception to a REST Response. If a plugin has its own types for which it wants to apply mappings, or if it wants to redefine the mappings for any of the standard exception types, those mappings should be applied before calling into this standard mapping as it provides fallback logic for mapping any exception type.

Parameters
exception the exception to map
Returns
  • the response for the exception