INNER CODE UNIT · TypeScript
AgentError
AgentDock/AgentDock · agentdock-core/src/errors/index.ts:80
export class AgentError extends Error {
constructor(
message: string,
public readonly code: ErrorCode,
public readonly details: Record<string, unknown> = {},
public readonly httpStatus: number = 500
) {
super(message);
this.name = 'AgentError';
// Ensure proper prototype chain for instanceof checks
Object.setPrototypeOf(this, new.target.prototype);
// Capture stack trace
if (Error.captureStackTrace) {
Error.captureStackTrace(this, this.constructor);
}
}