INNER CODE UNIT · TypeScript
createError
AgentDock/AgentDock · agentdock-core/src/errors/index.ts:150
export function createError(
category:
| ErrorCategory
| 'node'
| 'config'
| 'llm'
| 'api'
| 'storage'
| 'generic',
message: string,
code: ErrorCode,
details: Record<string, unknown> = {},
httpStatus: number = 500
): AgentError {
// Handle API errors
if (category === 'api' && 'path' in details && 'method' in details) {
return new APIError(
message,