Class ServerErrors
java.lang.Object
dev.tachyonmcp.core.server.domain.ServerErrors
Factories for protocol-neutral server errors.
-
Method Summary
Modifier and TypeMethodDescriptionstatic ServerErrorfromUnhandledException(Throwable cause, String internalErrorDetail) Default mapping for an exception a handler didn't translate to a wire error itself.static ServerErrorheaderMismatch(String detail) static ServerErrorinternalError(String detail) static ServerErrorinvalidParams(String detail) static ServerErrorinvalidRequest(String detail) static ServerErrormethodNotFound(String detail) static ServerErrormissingRequiredClientCapability(String detail, Map<String, Object> requiredCapabilities) error.data.requiredCapabilitiesis aClientCapabilities-shaped map, not a name list.static ServerErrorstatic ServerErrorresourceNotFound(String detail) static ServerErrorresourceNotFound(String detail, Map<String, String> data) static ServerErrorunsupportedProtocolVersion(String detail, Map<String, Object> data)
-
Method Details
-
parseError
-
invalidRequest
-
methodNotFound
-
invalidParams
-
internalError
-
fromUnhandledException
@InternalApi public static ServerError fromUnhandledException(Throwable cause, String internalErrorDetail) Default mapping for an exception a handler didn't translate to a wire error itself. A bareIllegalArgumentExceptionis treated as bad input (INVALID_PARAMS) without echoing its message, which may originate from arbitrary library code and isn't vetted for sensitive content — unlikeInvalidArgumentException, which handler authors throw deliberately with a message they control.MissingRequiredClientCapabilityExceptionmaps to its own wire error. Everything else is INTERNAL_ERROR. -
resourceNotFound
-
resourceNotFound
-
headerMismatch
-
missingRequiredClientCapability
public static ServerError missingRequiredClientCapability(String detail, Map<String, Object> requiredCapabilities) error.data.requiredCapabilitiesis aClientCapabilities-shaped map, not a name list. -
unsupportedProtocolVersion
-