Files
klz-cables.com/.pnpm-store/v10/files/7f/5774fd938e83e38dd0c6050874b78b1743c6c03f3e774617b650584004b1bf0d645fa51d0f0940689ccdaef24a5695950a728bcf4d609b451500de74f04af3
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

1 line
2.7 KiB
Plaintext

{"version":3,"sources":["../../src/errors/APIError.ts"],"sourcesContent":["import { status as httpStatus } from 'http-status'\n\n// This gets dynamically reassigned during compilation\nexport let APIErrorName = 'APIError'\n\nclass ExtendableError<TData extends object = { [key: string]: unknown }> extends Error {\n data: TData\n\n isOperational: boolean\n\n isPublic: boolean\n\n status: number\n\n constructor(message: string, status: number, data: TData, isPublic: boolean) {\n super(message, {\n // show data in cause\n cause: data,\n })\n APIErrorName = this.constructor.name\n this.name = this.constructor.name\n this.message = message\n this.status = status\n this.data = data\n this.isPublic = isPublic\n this.isOperational = true // This is required since bluebird 4 doesn't append it anymore.\n Error.captureStackTrace(this, this.constructor)\n }\n}\n\n/**\n * Class representing an API error.\n * @extends ExtendableError\n */\nexport class APIError<\n TData extends null | object = { [key: string]: unknown } | null,\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n> extends ExtendableError<TData> {\n /**\n * Creates an API error.\n * @param {string} message - Error message.\n * @param {number} status - HTTP status code of error.\n * @param {object} data - response data to be returned.\n * @param {boolean} isPublic - Whether the message should be visible to user or not.\n */\n constructor(\n message: string,\n status: number = httpStatus.INTERNAL_SERVER_ERROR,\n data: TData = null!,\n isPublic?: boolean,\n ) {\n super(\n message,\n status,\n data,\n typeof isPublic === 'boolean' ? isPublic : status !== httpStatus.INTERNAL_SERVER_ERROR,\n )\n }\n}\n"],"names":["status","httpStatus","APIErrorName","ExtendableError","Error","data","isOperational","isPublic","message","cause","name","captureStackTrace","APIError","INTERNAL_SERVER_ERROR"],"mappings":"AAAA,SAASA,UAAUC,UAAU,QAAQ,cAAa;AAElD,sDAAsD;AACtD,OAAO,IAAIC,eAAe,WAAU;AAEpC,MAAMC,wBAA2EC;IAC/EC,KAAW;IAEXC,cAAsB;IAEtBC,SAAiB;IAEjBP,OAAc;IAEd,YAAYQ,OAAe,EAAER,MAAc,EAAEK,IAAW,EAAEE,QAAiB,CAAE;QAC3E,KAAK,CAACC,SAAS;YACb,qBAAqB;YACrBC,OAAOJ;QACT;QACAH,eAAe,IAAI,CAAC,WAAW,CAACQ,IAAI;QACpC,IAAI,CAACA,IAAI,GAAG,IAAI,CAAC,WAAW,CAACA,IAAI;QACjC,IAAI,CAACF,OAAO,GAAGA;QACf,IAAI,CAACR,MAAM,GAAGA;QACd,IAAI,CAACK,IAAI,GAAGA;QACZ,IAAI,CAACE,QAAQ,GAAGA;QAChB,IAAI,CAACD,aAAa,GAAG,MAAK,+DAA+D;QACzFF,MAAMO,iBAAiB,CAAC,IAAI,EAAE,IAAI,CAAC,WAAW;IAChD;AACF;AAEA;;;CAGC,GACD,OAAO,MAAMC,iBAGHT;IACR;;;;;;GAMC,GACD,YACEK,OAAe,EACfR,SAAiBC,WAAWY,qBAAqB,EACjDR,OAAc,IAAK,EACnBE,QAAkB,CAClB;QACA,KAAK,CACHC,SACAR,QACAK,MACA,OAAOE,aAAa,YAAYA,WAAWP,WAAWC,WAAWY,qBAAqB;IAE1F;AACF"}