MCP Server Framework - v1.0.0
    Preparing search index...

    Module errors

    Framework Errors Module

    This module provides the error system for the MCP server framework. Application-specific errors should be created in app/errors/ by extending these base classes.

    import {
    FrameworkErrorFactory,
    AppError,
    ValidationError,
    ErrorCodes,
    } from './errors/index.js';

    // Using the factory
    throw FrameworkErrorFactory.validation.fieldRequired('name');

    // Using classes directly
    throw new ValidationError('Invalid input', { field: 'email' });

    // Checking error types
    if (FrameworkErrorFactory.isAppError(error)) {
    console.log(error.code, error.statusCode);
    }

    Interfaces

    JsonRpcErrorResponse

    Type Aliases

    ErrorCategoryType
    HttpStatusType
    JsonRpcErrorCodeType
    TransportErrorMessageKey

    Variables

    ErrorCategory
    ErrorCodes
    ErrorCodeToHttpStatus
    HttpStatus
    JsonRpcErrorCode
    REDACTED_PLACEHOLDER
    TransportErrorMessage
    VALIDATION_LIMITS

    Functions

    createJsonRpcError
    getHttpStatusForErrorCode
    isSensitiveKey
    isServerDefinedJsonRpcError
    isSpecDefinedJsonRpcError
    isValidJsonRpcErrorCode
    redactIfSensitive

    References

    AppError → AppError
    AuthenticationError → AuthenticationError
    AuthorizationError → AuthorizationError
    BaseErrorOptions → BaseErrorOptions
    ConfigurationError → ConfigurationError
    ConnectionError → ConnectionError
    ErrorCodeType → ErrorCodeType
    FrameworkErrorFactory → FrameworkErrorFactory
    FrameworkErrorFactoryType → FrameworkErrorFactoryType
    InternalError → InternalError
    McpProtocolError → McpProtocolError
    OperationCancelledError → OperationCancelledError
    OperationError → OperationError
    RegistryError → RegistryError
    SerializedError → SerializedError
    SessionError → SessionError
    TransportError → TransportError
    ValidationError → ValidationError
    ValidationErrorOptions → ValidationErrorOptions
    ValidationIssue → ValidationIssue