Class AccountingServiceExceptionMapper

java.lang.Object
org.gcube.accounting.service.rest.AccountingServiceExceptionMapper
All Implemented Interfaces:
jakarta.ws.rs.ext.ExceptionMapper<Exception>

@Provider public class AccountingServiceExceptionMapper extends Object implements jakarta.ws.rs.ext.ExceptionMapper<Exception>
Maps the exceptions to the responses of the service: a body that is not a valid list of records is answered 400 with a short message, the HTTP errors of the framework keep their status, and any other failure is answered 500 with a generic message, its details only in the log of the service.
Author:
Luca Frosini (ISTI - CNR)
  • Constructor Details

    • AccountingServiceExceptionMapper

      public AccountingServiceExceptionMapper()
  • Method Details

    • toResponse

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