Class GenericUncaughtExceptionMapper<T extends Throwable,E>

java.lang.Object
fr.paris.lutece.plugins.rest.service.mapper.GenericUncaughtExceptionMapper<T,E>
Type Parameters:
T - The sub-class of Throwable to catch
E - The entity type wanted in the Response
All Implemented Interfaces:
jakarta.ws.rs.ext.ExceptionMapper<T>
Direct Known Subclasses:
UncaughtThrowableMapper

public abstract class GenericUncaughtExceptionMapper<T extends Throwable,E> extends Object implements jakarta.ws.rs.ext.ExceptionMapper<T>
Generic exception mapper, implementing ExceptionMapper, used to convert uncaught exceptions to a proper Response to return.
To implement your own in a Lutece plugin or module using lutece-rest-plugin-rest, extend this class, annotate it with Provider, and add it as a bean in the context.xml file.
  • Field Details

  • Constructor Details

    • GenericUncaughtExceptionMapper

      public GenericUncaughtExceptionMapper()
  • Method Details

    • toResponse

      public jakarta.ws.rs.core.Response toResponse(T exception)
      Specified by:
      toResponse in interface jakarta.ws.rs.ext.ExceptionMapper<T extends Throwable>