Class IntakeExceptionMapper

java.lang.Object
ai.pipeline.connector.intake.error.IntakeExceptionMapper
All Implemented Interfaces:
jakarta.ws.rs.ext.ExceptionMapper<IntakeException>

@Provider public class IntakeExceptionMapper extends Object implements jakarta.ws.rs.ext.ExceptionMapper<IntakeException>
Renders every IntakeException as a uniform, client-safe JSON envelope and guarantees the real cause is logged server-side, never serialized.

Wire contract: an IntakeErrorResponse (error, code, optional errorId for server-faults, optional requestId) at the code's HTTP status — Jackson-serialized, never hand-built. 5xx are logged at ERROR with the cause (a service fault we must see) and carry a traceable errorId; 4xx at DEBUG (client mistakes). The x-request-id is echoed as a response header so a caller can quote it when reporting a failure.

  • Constructor Details

    • IntakeExceptionMapper

      public IntakeExceptionMapper()
  • Method Details

    • toResponse

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