UNPKG

@dev-fastn-ai/ucl-sdk

Version:

Fastn UCL SDK - A robust TypeScript SDK for integrating AI agents with Fastn UCL

65 lines 2.45 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.LLMError = exports.APIError = exports.MissingParametersError = exports.ConnectorNotActiveError = exports.ToolNotFoundError = exports.ConfigurationError = exports.AuthenticationError = exports.UCLError = void 0; class UCLError extends Error { constructor(message, code, statusCode, details) { super(message); this.name = 'UCLError'; this.code = code; if (statusCode !== undefined) { this.statusCode = statusCode; } this.details = details; } } exports.UCLError = UCLError; class AuthenticationError extends UCLError { constructor(message = 'Authentication failed', details) { super(message, 'AUTH_ERROR', 401, details); this.name = 'AuthenticationError'; } } exports.AuthenticationError = AuthenticationError; class ConfigurationError extends UCLError { constructor(message = 'Invalid configuration', details) { super(message, 'CONFIG_ERROR', 400, details); this.name = 'ConfigurationError'; } } exports.ConfigurationError = ConfigurationError; class ToolNotFoundError extends UCLError { constructor(toolName, details) { super(`Tool '${toolName}' not found`, 'TOOL_NOT_FOUND', 404, details); this.name = 'ToolNotFoundError'; } } exports.ToolNotFoundError = ToolNotFoundError; class ConnectorNotActiveError extends UCLError { constructor(connectorName, details) { super(`Connector '${connectorName}' is not active`, 'CONNECTOR_INACTIVE', 400, details); this.name = 'ConnectorNotActiveError'; } } exports.ConnectorNotActiveError = ConnectorNotActiveError; class MissingParametersError extends UCLError { constructor(missingParams, details) { super(`Missing required parameters: ${missingParams.join(', ')}`, 'MISSING_PARAMETERS', 400, details); this.name = 'MissingParametersError'; } } exports.MissingParametersError = MissingParametersError; class APIError extends UCLError { constructor(message, statusCode, details) { super(message, 'API_ERROR', statusCode, details); this.name = 'APIError'; } } exports.APIError = APIError; class LLMError extends UCLError { constructor(message, details) { super(message, 'LLM_ERROR', 500, details); this.name = 'LLMError'; } } exports.LLMError = LLMError; //# sourceMappingURL=errors.js.map