1 | {"version":3,"file":"errors.esm.js","sources":["../../src/utils/errors.ts"],"sourcesContent":["import makeError, { BaseError } from 'make-error';\n\n/**\n * `FetchError` represents an error that happened when fetching a URL.\n *\n * The `instanceof` operator can be used to check for this error.\n */\nexport class FetchError extends BaseError {\n constructor(\n /** URL originally fetched */\n readonly url: string,\n\n /** Response received */\n readonly response: Response\n ) {\n super(\n `fetch: request to ${url} failed with status ${response.statusText}`\n );\n }\n}\n\n/**\n * `InvalidPackageNameError` is thrown when the name of a package\n * is not valid according to the npm registry naming rules.\n *\n * The `instanceof` operator can be used to check for this error.\n *\n * @see {@link https://www.npmjs.com/package/validate-npm-package-name}\n */\nexport const InvalidPackageNameError = makeError('InvalidPackageNameError');\n\n/**\n * `InvalidPackageVersionError` is thrown when a package's version does not exist.\n *\n * The `instanceof` operator can be used to check for this error.\n */\nexport const InvalidPackageVersionError = makeError(\n 'InvalidPackageVersionError'\n);\n"],"names":["FetchError","BaseError","constructor","url","response","statusText","InvalidPackageNameError","makeError","InvalidPackageVersionError"],"mappings":";;AAEA;;;;;;MAKaA,mBAAmBC;AAC5BC,EAAAA;AACI;AACSC,EAAAA;AAET;AACSC,EAAAA;AAET,+BACyBD,0BAA0BC,QAAQ,CAACC,YAD5D;SALSF;SAGAC;AAHA,YAAA,GAAAD,GAAA;AAGA,iBAAA,GAAAC,QAAA;AAKZ;;;AAGL;;;;;;;;;MAQaE,uBAAuB,gBAAGC,SAAS,CAAC,yBAAD;AAEhD;;;;;;MAKaC,0BAA0B,gBAAGD,SAAS,CAC/C,4BAD+C;;;;"} |