Files
xo-cash-utils/source/sse-session/errors.ts
T
2026-09-17 07:51:48 +00:00

32 lines
844 B
TypeScript

/* eslint-disable max-classes-per-file */
/**
* Error thrown when a response body is null
*/
export class ResponseBodyNullError extends Error {
constructor() {
super('Response body is null');
this.name = 'ResponseBodyNullError';
}
}
/**
* Error thrown when an HTTP error occurs
*/
export class HTTPError extends Error {
constructor(status: number, message: string) {
super(`HTTP error! Status: ${status} - ${message}`);
this.name = 'HTTPError';
}
}
/**
* Error thrown when a plugin's unsubscribe function is not a function
*/
export class SSESessionUnsubscribePluginNotAFunctionError extends Error {
constructor(pluginName: string) {
super(`${pluginName}'s unsubscribe function is not a function`);
this.name = 'SSESessionUnsubscribePluginNotAFunctionError';
}
}