UNPKG

node-csfd-api

Version:

ČSFD API in JavaScript. Amazing NPM library for scrapping csfd.cz :)

24 lines (23 loc) 696 B
import { LIB_PREFIX } from "./vars.js"; //#region src/errors.ts /** * Raised when a page cannot be retrieved. `reason` says why, so callers can * tell "this movie does not exist" from "ČSFD is refusing us right now" and * react differently instead of guessing from a message. */ var CsfdError = class extends Error { reason; url; /** HTTP status, when the request got far enough to have one. */ status; constructor(reason, url, message, options) { super(`${LIB_PREFIX} ${message}`, { cause: options?.cause }); this.name = "CsfdError"; this.reason = reason; this.url = url; this.status = options?.status; } }; //#endregion export { CsfdError }; //# sourceMappingURL=errors.js.map