channel3-sdk
Version:
The official TypeScript/JavaScript SDK for Channel3 AI Shopping API
42 lines • 1.48 kB
JavaScript
/**
* Custom error classes for the Channel3 SDK
*/
export class Channel3Error extends Error {
constructor(message, statusCode, responseData) {
super(message);
this.name = "Channel3Error";
this.statusCode = statusCode;
this.responseData = responseData;
}
}
export class Channel3AuthenticationError extends Channel3Error {
constructor(message = "Invalid or missing API key", statusCode, responseData) {
super(message, statusCode, responseData);
this.name = "Channel3AuthenticationError";
}
}
export class Channel3ValidationError extends Channel3Error {
constructor(message, statusCode, responseData) {
super(message, statusCode, responseData);
this.name = "Channel3ValidationError";
}
}
export class Channel3NotFoundError extends Channel3Error {
constructor(message, statusCode, responseData) {
super(message, statusCode, responseData);
this.name = "Channel3NotFoundError";
}
}
export class Channel3ServerError extends Channel3Error {
constructor(message = "Internal server error", statusCode, responseData) {
super(message, statusCode, responseData);
this.name = "Channel3ServerError";
}
}
export class Channel3ConnectionError extends Channel3Error {
constructor(message, statusCode, responseData) {
super(message, statusCode, responseData);
this.name = "Channel3ConnectionError";
}
}
//# sourceMappingURL=exceptions.js.map