Creates an instance of AgentOSServiceError.
A human-readable description of the error.
A specific error code, typically from GMIErrorCode,
identifying the nature of the error.
Optional details: anyOptional. Additional structured details or the underlying error object that caused this service error.
Optional componentOrigin: stringOptional. The name of the component or sub-module within AgentOS where the error originated or was detected. This helps in pinpointing the error's source.
Static wrapWraps an existing error object (which could be of any type) within a new AgentOSServiceError instance.
This is useful for standardizing errors caught from lower layers or external libraries.
The original error object to wrap.
The GMIErrorCode to assign to the new AgentOSServiceError.
A new, overarching message for the AgentOSServiceError. The original
error's message will typically be included in the details.
Optional componentOrigin: stringOptional. The component where this wrapping is occurring or where the original error was caught and is being standardized.
A new instance of AgentOSServiceError encapsulating the original error.
try {
// some operation that might throw
} catch (e: unknown) {
throw AgentOSServiceError.wrap(e, GMIErrorCode.INTERNAL_SERVER_ERROR, "Failed to process user request", "RequestHandler");
}
Static isGMIErrorReadonly nameSpecifies the name of the error class, used for identification.
Readonly codeOptional Readonly detailsOptional Readonly componentReadonly timestampOptional Readonly httpOptional Readonly cause
AgentOSServiceError
Description
Custom error class for errors specifically originating from the AgentOS service facade. This class provides a standardized way to represent errors encountered within the
AgentOSclass, inheriting common error properties fromGMIErrorand setting a distinct error name.