Class IntakeException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
ai.pipeline.connector.intake.error.IntakeException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
HttpIntakeException, IntakeServiceException

public abstract class IntakeException extends RuntimeException
Base type for every failure the intake HTTP surface deliberately surfaces.

An IntakeException is the boundary between what went wrong internally (the cause — logged, never serialized) and what the client is told (the code() plus clientMessage() — curated, safe, stable).

Anything thrown out of a resource that is not an IntakeException is treated as an unexpected internal error: callers are expected to translate upstream/runtime failures into one of these so that IntakeExceptionMapper can render a uniform envelope and no raw message ever reaches the wire.

See Also:
  • Constructor Details

  • Method Details

    • code

      public IntakeErrorCode code()
    • httpStatus

      public int httpStatus()
    • isError

      public boolean isError()
      true when this is a server-side error (5xx) rather than a client rejection (4xx). An error is not the caller's fault — even a valid account can hit one — so it carries a traceable errorId().
    • errorId

      public String errorId()
      Unique, traceable id for a server-fault occurrence; empty for client rejections. Clock-derived (not a UUID, never random) and support-quotable.
    • clientMessage

      public String clientMessage()
      Safe, client-facing message. Never contains upstream or internal detail; the real failure lives in Throwable.getCause() and is only ever logged.
    • clientFacingMessage

      public String clientFacingMessage()
      Client message with the errorId appended for server-faults — for surfaces (gRPC in-band responses) that have no dedicated errorId field yet.
    • withTrackingToken

      public IntakeException withTrackingToken(String token)
      Attach the status-tracking token (when a doc_id was derived). Returns this for fluent rethrow.
    • trackingToken

      public String trackingToken()
      The status-tracking token, or empty when no doc_id was derivable before the failure.