UNPKG

linkup-sdk

Version:
79 lines 3.36 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.LinkupUnknownError = exports.LinkupTooManyRequestsError = exports.LinkupInsufficientCreditError = exports.LinkupAuthenticationError = exports.LinkupNoResultError = exports.LinkupInvalidRequestError = exports.LinkupError = void 0; class LinkupError extends Error { } exports.LinkupError = LinkupError; // Invalid request error, raised when the Linkup API returns a 400 status code. // It is returned by the Linkup API when the request is invalid, typically when a mandatory // parameter is missing, or isn't valid (type, structure, etc.). class LinkupInvalidRequestError extends LinkupError { constructor(message) { super(message); this.name = LinkupInvalidRequestError.name; if ('captureStackTrace' in Error) { Error.captureStackTrace(this, LinkupInvalidRequestError); } } } exports.LinkupInvalidRequestError = LinkupInvalidRequestError; // No result error, raised when the Linkup API returns a 400 status code. // It is returned by the Linkup API when the search query did not yield any result. class LinkupNoResultError extends LinkupError { constructor(message) { super(message); this.name = LinkupNoResultError.name; if ('captureStackTrace' in Error) { Error.captureStackTrace(this, LinkupNoResultError); } } } exports.LinkupNoResultError = LinkupNoResultError; // Authentication error, raised when the Linkup API returns a 403 status code. // It is returned when there is an authentication issue, typically when the API key is not valid. class LinkupAuthenticationError extends Error { constructor(message) { super(message); this.name = LinkupAuthenticationError.name; if ('captureStackTrace' in Error) { Error.captureStackTrace(this, LinkupAuthenticationError); } } } exports.LinkupAuthenticationError = LinkupAuthenticationError; // Insufficient credit error, raised when the Linkup API returns a 429 status code. // It is returned when you have run out of credits. class LinkupInsufficientCreditError extends LinkupError { constructor(message) { super(message); this.name = LinkupInsufficientCreditError.name; if ('captureStackTrace' in Error) { Error.captureStackTrace(this, LinkupInsufficientCreditError); } } } exports.LinkupInsufficientCreditError = LinkupInsufficientCreditError; // Too many requests error, raised when the Linkup API returns a 429 status code. // It is returned when you are sending too many requests at a time. class LinkupTooManyRequestsError extends LinkupError { constructor(message) { super(message); this.name = LinkupTooManyRequestsError.name; if ('captureStackTrace' in Error) { Error.captureStackTrace(this, LinkupTooManyRequestsError); } } } exports.LinkupTooManyRequestsError = LinkupTooManyRequestsError; // Unknown error class LinkupUnknownError extends LinkupError { constructor(message) { super(message); this.name = LinkupUnknownError.name; if ('captureStackTrace' in Error) { Error.captureStackTrace(this, LinkupUnknownError); } } } exports.LinkupUnknownError = LinkupUnknownError; //# sourceMappingURL=errors.js.map