UNPKG

@zestic/oauth-core

Version:

Framework-agnostic OAuth authentication library with support for multiple OAuth flows

20 lines 1.1 kB
/** * Standardized error handling for OAuth operations */ import { OAuthError, OAuthErrorCode } from '../types/OAuthTypes'; export declare class ErrorHandler { static createError(message: string, code: OAuthErrorCode, originalError?: Error): OAuthError; static handleNetworkError(error: Error): OAuthError; static handleTokenExchangeError(error: Error, response?: unknown): OAuthError; static handleInvalidState(expectedState?: string, receivedState?: string): OAuthError; static handleMissingParameter(parameterName: string): OAuthError; static handleInvalidConfiguration(message: string): OAuthError; static handleUnknownFlow(flowName: string): OAuthError; static handleNoFlowHandler(): OAuthError; static handleFlowValidationFailed(flowName: string, reason?: string): OAuthError; static isOAuthError(error: unknown): error is OAuthError; static getErrorCode(error: unknown): string | undefined; static formatError(error: unknown): string; static logError(error: unknown, context?: string): void; } //# sourceMappingURL=ErrorHandler.d.ts.map