sec-edgar-toolkit
Version:
Open source toolkit to facilitate working with the SEC EDGAR database
36 lines • 1.17 kB
JavaScript
;
/**
* Base exception classes for SEC EDGAR Toolkit
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.NotFoundError = exports.AuthenticationError = exports.RateLimitError = exports.SecEdgarApiError = void 0;
class SecEdgarApiError extends Error {
constructor(message, statusCode) {
super(message);
this.statusCode = statusCode;
this.name = 'SecEdgarApiError';
}
}
exports.SecEdgarApiError = SecEdgarApiError;
class RateLimitError extends SecEdgarApiError {
constructor(message = 'Rate limit exceeded') {
super(message, 429);
this.name = 'RateLimitError';
}
}
exports.RateLimitError = RateLimitError;
class AuthenticationError extends SecEdgarApiError {
constructor(message = 'Authentication failed') {
super(message, 401);
this.name = 'AuthenticationError';
}
}
exports.AuthenticationError = AuthenticationError;
class NotFoundError extends SecEdgarApiError {
constructor(message = 'Resource not found') {
super(message, 404);
this.name = 'NotFoundError';
}
}
exports.NotFoundError = NotFoundError;
//# sourceMappingURL=base.js.map