/** * Copyright 2025 Angus.Fenying * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ type IErrorContext = Record; /** * The error class for websocket. * * @noInheritDoc */ export declare abstract class WsError extends Error { /** * The context information for the error. */ readonly context: IErrorContext; /** * The origin object for the error. */ readonly origin: unknown; constructor(name: string, message: string, context: IErrorContext, origin: unknown); } export declare class E_CONN_LOST extends WsError { constructor(context?: IErrorContext, origin?: unknown); } export declare class E_CONN_READONLY extends WsError { constructor(context?: IErrorContext, origin?: unknown); } export declare class E_CONN_BUSY extends WsError { constructor(context?: IErrorContext, origin?: unknown); } export declare class E_INTERNAL_ERROR extends WsError { constructor(context?: IErrorContext, origin?: unknown); } export declare class E_FRAME_ENDED extends WsError { constructor(context?: IErrorContext, origin?: unknown); } export declare class E_FRAME_BROKEN extends WsError { constructor(context?: IErrorContext, origin?: unknown); } export declare class E_MESSAGE_TOO_LARGE extends WsError { constructor(context?: IErrorContext, origin?: unknown); } export declare class E_INVALID_PROTOCOL extends WsError { constructor(message: string, context?: IErrorContext, origin?: unknown); } export declare class E_TIMEOUT extends WsError { constructor(context?: IErrorContext, origin?: unknown); } export declare class E_INVALID_CONFIG extends WsError { constructor(context?: IErrorContext, origin?: unknown); } export declare class E_HANDSHAKE_FAILED extends WsError { constructor(message: string, context?: IErrorContext, origin?: unknown); } export {}; //# sourceMappingURL=Errors.d.ts.map