Class AgentProtocolException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
nl.pim16aap2.lightkeeper.protocol.AgentProtocolException
- All Implemented Interfaces:
Serializable
Thrown by agent request handlers to signal a structured protocol-level failure.
The dispatcher catches this exception and serializes it as an error response using
AgentErrorCode.wireCode() rather than the generic REQUEST_FAILED code.
Example:
throw new AgentProtocolException(AgentErrorCode.AUTH_FAILED, "Auth token mismatch.");
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAgentProtocolException(AgentErrorCode errorCode, String message) AgentProtocolException(AgentErrorCode errorCode, String message, Throwable cause) -
Method Summary
Modifier and TypeMethodDescriptionReturns the error code that the dispatcher should include in the wire response.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
AgentProtocolException
- Parameters:
errorCode- Stable machine-readable error code for this failure.message- Human-readable failure detail.
-
AgentProtocolException
- Parameters:
errorCode- Stable machine-readable error code for this failure.message- Human-readable failure detail.cause- Underlying exception that triggered this failure.
-
-
Method Details
-
errorCode
Returns the error code that the dispatcher should include in the wire response.- Returns:
- Non-null error code.
-