Skip to main content
Glama
errors.ts•1.22 kB
export class AppError extends Error { constructor( public readonly message: string, public readonly statusCode: number = 500, public readonly code: string = 'INTERNAL_ERROR', public readonly details?: unknown, ) { super(message); this.name = this.constructor.name; Error.captureStackTrace(this, this.constructor); } } export class NotFoundError extends AppError { constructor(message: string) { super(message, 404, 'NOT_FOUND'); this.name = 'NotFoundError'; } } export class ValidationError extends AppError { constructor(message: string, details?: unknown) { super(message, 400, 'VALIDATION_ERROR', details); this.name = 'ValidationError'; } } export class UnauthorizedError extends AppError { constructor(message: string = 'Unauthorized') { super(message, 401, 'UNAUTHORIZED'); this.name = 'UnauthorizedError'; } } export class ForbiddenError extends AppError { constructor(message: string = 'Forbidden') { super(message, 403, 'FORBIDDEN'); this.name = 'ForbiddenError'; } } export class ConflictError extends AppError { constructor(message: string) { super(message, 409, 'CONFLICT'); this.name = 'ConflictError'; } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/jatinderbhola/mcp-taskflow-tracker-api'

If you have feedback or need assistance with the MCP directory API, please join our Discord server