{"version":3,"sources":["utils/notify-error-reporter.ts"],"names":["ExtendedApiError","Notify","notifyAndThrowExtendedApiError","error","notify","errorMessage","notifyAndLogStandardApiError","message","console","exceptionType","exceptionMessage","notifyExtendedApiError","logExtendedApiError","devErrorMessage","logStandardApiError","standardToExtendedApiReporter","standardErrorReporter","errorDetails","stackTrace","devStackTrace"],"mappings":"OAESA,qBAAwB,2CACxBC,WAAc,cAEjB,SAAUC,+BAA+BC,GAC3C,MAAMC,EAAS,IAAIH,OAEnB,MADAG,EAAOD,MAAMA,EAAME,cACb,IAAIL,iBAAiBG,GAGzB,SAAUG,6BAA6BH,GACzC,MAAMC,EAAS,IAAIH,OACnBG,EAAOD,MAAM,GAAGA,EAAMI,SACtBC,QAAQL,SAASA,EAAMI,oBAAoBJ,EAAMM,kBAAkBN,EAAMO,qBAGvE,SAAUC,uBAAuBR,GACnC,MAAMC,EAAS,IAAIH,OACnBG,EAAOD,MAAM,GAAGA,EAAME,cAGpB,SAAUO,oBAAoBT,GAChCK,QAAQL,MAAM,IAAGA,EAAMU,iBAA0CV,EAAME,eAGrE,SAAUS,oBAAoBX,GAChCK,QAAQL,SAASA,EAAMI,oBAAoBJ,EAAMM,kBAAkBN,EAAMO,qBAGvE,SAAUK,8BAA8BC,GAC1C,OAAO,IACH,IAAMC,EAAe,CACjBV,QAASJ,EAAME,aACfK,iBAAkBP,EAAMU,gBACxBK,WAAYf,EAAMgB,eAGtBH,EAAsBC,WAjCdf,+BAMAI,6BAMAK,uBAKAC,oBAIAE,oBAIAC","file":"notify-error-reporter.js","sourcesContent":["import { IStandardApiError } from \"../api/base/i-standard-api-error.js\";\r\nimport { IExtendedApiError } from \"../api/base/i-extended-api-error.js\";\r\nimport { ExtendedApiError } from \"../api/base/extended-api-error.js\";\r\nimport { Notify } from \"./notify.js\";\r\n\r\nexport function notifyAndThrowExtendedApiError(error: IExtendedApiError) {\r\n const notify = new Notify();\r\n notify.error(error.errorMessage);\r\n throw new ExtendedApiError(error);\r\n}\r\n\r\nexport function notifyAndLogStandardApiError(error: IStandardApiError) {\r\n const notify = new Notify();\r\n notify.error(`${error.message}`);\r\n console.error(`${error.message} Details: ${error.exceptionType}. ${error.exceptionMessage}.`);\r\n}\r\n\r\nexport function notifyExtendedApiError(error: IExtendedApiError) {\r\n const notify = new Notify();\r\n notify.error(`${error.errorMessage}`); \r\n}\r\n\r\nexport function logExtendedApiError(error: IExtendedApiError) {\r\n console.error(`${error.devErrorMessage ? error.devErrorMessage : error.errorMessage}`);\r\n}\r\n\r\nexport function logStandardApiError(error: IStandardApiError) {\r\n console.error(`${error.message} Details: ${error.exceptionType}. ${error.exceptionMessage}.`);\r\n}\r\n\r\nexport function standardToExtendedApiReporter(standardErrorReporter: (error: IStandardApiError) => void): (error: IExtendedApiError) => void{\r\n return (error: IExtendedApiError) => {\r\n const errorDetails = {\r\n message: error.errorMessage,\r\n exceptionMessage: error.devErrorMessage,\r\n stackTrace: error.devStackTrace\r\n } as IStandardApiError;\r\n\r\n standardErrorReporter(errorDetails);\r\n }\r\n}\r\n"]}