{"version":3,"sources":["utils/notify-error-reporter.ts"],"names":["ExtendedApiError","Notify","notifyAndThrowExtendedApiError","error","duration","errorMessage","notifyAndLogStandardApiError","message","console","exceptionType","exceptionMessage","notifyExtendedApiError","logExtendedApiError","devErrorMessage","logStandardApiError","standardToExtendedApiReporter","standardErrorReporter","errorDetails","stackTrace","devStackTrace"],"mappings":"OAESA,gBAA2D,KAAnC,2CACxBC,MAA2B,KAAb,cAEjB,SAAUC,+BAA+BC,EAA0BC,EAAmB,KAGxF,MAFe,IAAIH,OAAOG,CAAQ,EAC3BD,MAAMA,EAAME,YAAY,EACzB,IAAIL,iBAAiBG,CAAK,CACpC,CAEM,SAAUG,6BAA6BH,EAA0BC,EAAmB,KACvE,IAAIH,OAAOG,CAAQ,EAC3BD,MAAM,GAAGA,EAAMI,OAAS,EAC/BC,QAAQL,SAASA,EAAMI,oBAAoBJ,EAAMM,kBAAkBN,EAAMO,mBAAmB,CAChG,CAEM,SAAUC,uBAAuBR,EAA0BC,EAAmB,KACjE,IAAIH,OAAOG,CAAQ,EAC3BD,MAAM,GAAGA,EAAME,YAAc,CACxC,CAEM,SAAUO,oBAAoBT,GAChCK,QAAQL,MAAM,IAAGA,EAAMU,iBAA0CV,EAAME,aAAc,CACzF,CAEM,SAAUS,oBAAoBX,GAChCK,QAAQL,SAASA,EAAMI,oBAAoBJ,EAAMM,kBAAkBN,EAAMO,mBAAmB,CAChG,CAEM,SAAUK,8BAA8BC,GAC1C,OAAO,IACH,IAAMC,EAAe,CACjBV,QAASJ,EAAME,aACfK,iBAAkBP,EAAMU,gBACxBK,WAAYf,EAAMgB,a,EAGtBH,EAAsBC,CAAY,CACtC,CACJ,QAnCgBf,+BAMAI,6BAMAK,uBAKAC,oBAIAE,oBAIAC,6BAUhB","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, duration: number = 8000) {\r\n const notify = new Notify(duration);\r\n notify.error(error.errorMessage);\r\n throw new ExtendedApiError(error);\r\n}\r\n\r\nexport function notifyAndLogStandardApiError(error: IStandardApiError, duration: number = 8000) {\r\n const notify = new Notify(duration);\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, duration: number = 8000) {\r\n const notify = new Notify(duration);\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"]}