Class DataIntegrityViolationExceptionMapper

java.lang.Object
uk.co.jasonmarston.kiunzi.utility.exception.mapper.DataIntegrityViolationExceptionMapper
All Implemented Interfaces:
jakarta.ws.rs.ext.ExceptionMapper<uk.co.jasonmarston.kiunzi.utility.domain.exception.DataIntegrityViolationException>

@Provider public class DataIntegrityViolationExceptionMapper extends Object implements jakarta.ws.rs.ext.ExceptionMapper<uk.co.jasonmarston.kiunzi.utility.domain.exception.DataIntegrityViolationException>
Maps DataIntegrityViolationException instances to HTTP 500 responses.

This mapper is typically used for persistence-layer integrity failures that do not have a more specific client-facing representation.

See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a mapper for data-integrity violations.
  • Method Summary

    Modifier and Type
    Method
    Description
    jakarta.ws.rs.core.Response
    toResponse(uk.co.jasonmarston.kiunzi.utility.domain.exception.DataIntegrityViolationException ex)
    Converts the supplied data-integrity exception into an HTTP response.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DataIntegrityViolationExceptionMapper

      public DataIntegrityViolationExceptionMapper()
      Creates a mapper for data-integrity violations.
  • Method Details

    • toResponse

      public jakarta.ws.rs.core.Response toResponse(uk.co.jasonmarston.kiunzi.utility.domain.exception.DataIntegrityViolationException ex)
      Converts the supplied data-integrity exception into an HTTP response.
      Specified by:
      toResponse in interface jakarta.ws.rs.ext.ExceptionMapper<uk.co.jasonmarston.kiunzi.utility.domain.exception.DataIntegrityViolationException>
      Parameters:
      ex - the data-integrity exception raised while processing the request
      Returns:
      an HTTP 500 response containing an ErrorResponse body