Class NGSICompliantExceptionHandler<T extends Throwable>

java.lang.Object
org.fiware.mintaka.exception.NGSICompliantExceptionHandler<T>
Type Parameters:
T - exception type, extends Throwable
All Implemented Interfaces:
io.micronaut.http.server.exceptions.ExceptionHandler<T,io.micronaut.http.HttpResponse<ProblemDetails>>
Direct Known Subclasses:
AttributeExpansionExceptionHandler, CannotCreateTransactionExceptionHandler, ContextRetrievalExceptionHandler, IllegalArgumentsExceptionHandler, InvalidTimeRelationExceptionHandler, JacksonConversionExceptionHandler, PersistenceRetrievalExceptionHandler

public abstract class NGSICompliantExceptionHandler<T extends Throwable> extends Object implements io.micronaut.http.server.exceptions.ExceptionHandler<T,io.micronaut.http.HttpResponse<ProblemDetails>>
Base exception handler to produce NGSI-LD compliant http responses.
  • Constructor Details

    • NGSICompliantExceptionHandler

      public NGSICompliantExceptionHandler()
  • Method Details

    • handle

      public io.micronaut.http.HttpResponse<ProblemDetails> handle(io.micronaut.http.HttpRequest request, T exception)
      Specified by:
      handle in interface io.micronaut.http.server.exceptions.ExceptionHandler<T extends Throwable,io.micronaut.http.HttpResponse<ProblemDetails>>
    • getAssociatedErrorType

      public abstract ErrorType getAssociatedErrorType()
      Return the ErrorType associated with the concrete exception
      Returns:
      the error-type
    • getStatus

      public abstract io.micronaut.http.HttpStatus getStatus()
      Return the http status associated with the exception
      Returns:
      the http status
    • getErrorTitle

      public abstract String getErrorTitle()
      Return the error title to be used in the problem details
      Returns:
      the error title
    • getInstance

      @Nullable public abstract String getInstance(io.micronaut.http.HttpRequest request, T exception)
      Id of an instance associated with the error.
      Parameters:
      request - erroneous request
      exception - the concrete exception
      Returns:
      the instance id, null if no such instance can be identified.