@openmrs/esm-error-handling 5.0.3-pre.826 → 5.0.3-pre.829

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,7 +1,7 @@
1
- @openmrs/esm-error-handling:build: cache hit, replaying output c640469604f15d3c
2
- @openmrs/esm-error-handling:build: asset openmrs-esm-error-handling.js 1.75 KiB [emitted] [minimized] (name: main) 1 related asset
1
+ @openmrs/esm-error-handling:build: cache hit, replaying output 0dd6c751c9188dbd
2
+ @openmrs/esm-error-handling:build: asset openmrs-esm-error-handling.js 1.87 KiB [emitted] [minimized] (name: main) 1 related asset
3
3
  @openmrs/esm-error-handling:build: runtime modules 670 bytes 3 modules
4
- @openmrs/esm-error-handling:build: built modules 1.83 KiB [built]
5
- @openmrs/esm-error-handling:build:  ./src/index.ts 1.79 KiB [built] [code generated]
4
+ @openmrs/esm-error-handling:build: built modules 2.08 KiB [built]
5
+ @openmrs/esm-error-handling:build:  ./src/index.ts 2.04 KiB [built] [code generated]
6
6
  @openmrs/esm-error-handling:build:  external "@openmrs/esm-globals" 42 bytes [built] [code generated]
7
- @openmrs/esm-error-handling:build: webpack 5.88.0 compiled successfully in 14700 ms
7
+ @openmrs/esm-error-handling:build: webpack 5.88.0 compiled successfully in 13301 ms
@@ -1,2 +1,2 @@
1
- System.register(["@openmrs/esm-globals"],(function(r,e){var o={};return{setters:[function(r){o.dispatchNotificationShown=r.dispatchNotificationShown}],execute:function(){r((()=>{"use strict";var r={728:r=>{r.exports=o}},e={};function t(o){var n=e[o];if(void 0!==n)return n.exports;var i=e[o]={exports:{}};return r[o](i,i.exports,t),i.exports}t.d=(r,e)=>{for(var o in e)t.o(e,o)&&!t.o(r,o)&&Object.defineProperty(r,o,{enumerable:!0,get:e[o]})},t.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e),t.r=r=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})};var n={};return(()=>{t.r(n),t.d(n,{createErrorHandler:()=>o,reportError:()=>e});var r=t(728);function e(r){const e=i(r);setTimeout((()=>{throw e}))}function o(){const r=Error();return o=>{i(o).stack+=`\nAsync stacktrace:\n${r.stack}`,e(o)}}function i(r){let e;if(r instanceof Error)return r;if(null===r)return Error("'null' was thrown as an error");if("object"==typeof r){try{e=`Object thrown as error: ${JSON.stringify(r)}`}catch(o){e=`Object thrown as error with the following properties: ${Object.keys(r)}`}return Error(e)}return void 0===r?Error("'undefined' was thrown as an error"):Error(r.toString())}window.onerror=function(e){return console.error("Unexpected error: ",e),(0,r.dispatchNotificationShown)({description:null!=e?e:"Oops! An unexpected error occurred.",kind:"error",title:"Error"}),!1},window.onunhandledrejection=function(e){var o;console.error("Unhandled rejection: ",e.reason),(0,r.dispatchNotificationShown)({description:null!==(o=e.reason)&&void 0!==o?o:"Oops! An unhandled promise rejection occurred.",kind:"error",title:"Error"})}})(),n})())}}}));
1
+ System.register(["@openmrs/esm-globals"],(function(r,e){var o={};return{setters:[function(r){o.dispatchNotificationShown=r.dispatchNotificationShown}],execute:function(){r((()=>{"use strict";var r={728:r=>{r.exports=o}},e={};function n(o){var t=e[o];if(void 0!==t)return t.exports;var i=e[o]={exports:{}};return r[o](i,i.exports,n),i.exports}n.d=(r,e)=>{for(var o in e)n.o(e,o)&&!n.o(r,o)&&Object.defineProperty(r,o,{enumerable:!0,get:e[o]})},n.o=(r,e)=>Object.prototype.hasOwnProperty.call(r,e),n.r=r=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(r,"__esModule",{value:!0})};var t={};return(()=>{n.r(t),n.d(t,{createErrorHandler:()=>o,reportError:()=>e});var r=n(728);function e(r){var e=i(r);setTimeout((function(){throw e}))}function o(){var r=Error();return function(o){i(o).stack+="\nAsync stacktrace:\n".concat(r.stack),e(o)}}function i(r){var e,o,n;if(o=r,null!=(n=Error)&&"undefined"!=typeof Symbol&&n[Symbol.hasInstance]?n[Symbol.hasInstance](o):o instanceof n)return r;if(null===r)return Error("'null' was thrown as an error");if("object"==typeof r){try{e="Object thrown as error: ".concat(JSON.stringify(r))}catch(o){e="Object thrown as error with the following properties: ".concat(Object.keys(r))}return Error(e)}return void 0===r?Error("'undefined' was thrown as an error"):Error(r.toString())}window.onerror=function(e){return console.error("Unexpected error: ",e),(0,r.dispatchNotificationShown)({description:null!=e?e:"Oops! An unexpected error occurred.",kind:"error",title:"Error"}),!1},window.onunhandledrejection=function(e){var o;console.error("Unhandled rejection: ",e.reason),(0,r.dispatchNotificationShown)({description:null!==(o=e.reason)&&void 0!==o?o:"Oops! An unhandled promise rejection occurred.",kind:"error",title:"Error"})}})(),t})())}}}));
2
2
  //# sourceMappingURL=openmrs-esm-error-handling.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"openmrs-esm-error-handling.js","mappings":"8MAAAA,EAAOC,QAAUC,C,GCCbC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaL,QAGrB,IAAID,EAASG,EAAyBE,GAAY,CAGjDJ,QAAS,CAAC,GAOX,OAHAO,EAAoBH,GAAUL,EAAQA,EAAOC,QAASG,GAG/CJ,EAAOC,OACf,CCrBAG,EAAoBK,EAAI,CAACR,EAASS,KACjC,IAAI,IAAIC,KAAOD,EACXN,EAAoBQ,EAAEF,EAAYC,KAASP,EAAoBQ,EAAEX,EAASU,IAC5EE,OAAOC,eAAeb,EAASU,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE1E,ECNDP,EAAoBQ,EAAI,CAACK,EAAKC,IAAUL,OAAOM,UAAUC,eAAeC,KAAKJ,EAAKC,GCClFd,EAAoBkB,EAAKrB,IACH,oBAAXsB,QAA0BA,OAAOC,aAC1CX,OAAOC,eAAeb,EAASsB,OAAOC,YAAa,CAAEC,MAAO,WAE7DZ,OAAOC,eAAeb,EAAS,aAAc,CAAEwB,OAAO,GAAO,E,6FCcvD,SAASC,EAAYC,GACxB,MAAMC,EAAQC,EAAkBF,GAChCG,YAAW,KACP,MAAMF,CAAK,GAEnB,CACO,SAASG,IACZ,MAAMC,EAAcC,QACpB,OAAQC,IACaL,EAAkBK,GAC1BC,OAAS,wBAAwBH,EAAYG,QACtDT,EAAYQ,EAAY,CAEhC,CACA,SAASL,EAAkBO,GACvB,IAAIC,EACJ,GAAID,aAAiBH,MACjB,OAAOG,EACJ,GAAc,OAAVA,EACP,OAAOH,MAAM,iCACV,GAAqB,iBAAVG,EAAoB,CAClC,IACIC,EAAU,2BAA2BC,KAAKC,UAAUH,IACxD,CAAE,MAAOI,GACLH,EAAU,yDAAyDxB,OAAO4B,KAAKL,IACnF,CACA,OAAOH,MAAMI,EACjB,CAAO,YAAc9B,IAAV6B,EACAH,MAAM,sCAENA,MAAMG,EAAMM,WAE3B,CAlDAC,OAAOC,QAAU,SAAShB,GAOtB,OANAiB,QAAQjB,MAAM,qBAAsBA,IACpC,IAAAkB,2BAA0B,CACtBC,YAAanB,QAAqCA,EAAQ,sCAC1DoB,KAAM,QACNC,MAAO,WAEJ,CACX,EACAN,OAAOO,qBAAuB,SAASC,GAEnC,IAAIC,EADJP,QAAQjB,MAAM,wBAAyBuB,EAAME,SAE7C,IAAAP,2BAA0B,CACtBC,YAAgD,QAAlCK,EAAgBD,EAAME,cAAsC,IAAlBD,EAA2BA,EAAgB,iDACnGJ,KAAM,QACNC,MAAO,SAEf,C","sources":["webpack://@openmrs/esm-error-handling/external system \"@openmrs/esm-globals\"","webpack://@openmrs/esm-error-handling/webpack/bootstrap","webpack://@openmrs/esm-error-handling/webpack/runtime/define property getters","webpack://@openmrs/esm-error-handling/webpack/runtime/hasOwnProperty shorthand","webpack://@openmrs/esm-error-handling/webpack/runtime/make namespace object","webpack://@openmrs/esm-error-handling/./src/index.ts"],"sourcesContent":["module.exports = __WEBPACK_EXTERNAL_MODULE__728__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/** @module @category Error Handling */ import { dispatchNotificationShown } from \"@openmrs/esm-globals\";\nwindow.onerror = function(error) {\n console.error(\"Unexpected error: \", error);\n dispatchNotificationShown({\n description: error !== null && error !== void 0 ? error : \"Oops! An unexpected error occurred.\",\n kind: \"error\",\n title: \"Error\"\n });\n return false;\n};\nwindow.onunhandledrejection = function(event) {\n console.error(\"Unhandled rejection: \", event.reason);\n var _event_reason;\n dispatchNotificationShown({\n description: (_event_reason = event.reason) !== null && _event_reason !== void 0 ? _event_reason : \"Oops! An unhandled promise rejection occurred.\",\n kind: \"error\",\n title: \"Error\"\n });\n};\nexport function reportError(err) {\n const error = ensureErrorObject(err);\n setTimeout(()=>{\n throw error;\n });\n}\nexport function createErrorHandler() {\n const outgoingErr = Error();\n return (incomingErr)=>{\n const finalErr = ensureErrorObject(incomingErr);\n finalErr.stack += `\\nAsync stacktrace:\\n${outgoingErr.stack}`;\n reportError(incomingErr);\n };\n}\nfunction ensureErrorObject(thing) {\n let message;\n if (thing instanceof Error) {\n return thing;\n } else if (thing === null) {\n return Error(`'null' was thrown as an error`);\n } else if (typeof thing === \"object\") {\n try {\n message = `Object thrown as error: ${JSON.stringify(thing)}`;\n } catch (e) {\n message = `Object thrown as error with the following properties: ${Object.keys(thing)}`;\n }\n return Error(message);\n } else if (thing === undefined) {\n return Error(`'undefined' was thrown as an error`);\n } else {\n return Error(thing.toString());\n }\n}\n"],"names":["module","exports","__WEBPACK_EXTERNAL_MODULE__728__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","reportError","err","error","ensureErrorObject","setTimeout","createErrorHandler","outgoingErr","Error","incomingErr","stack","thing","message","JSON","stringify","e","keys","toString","window","onerror","console","dispatchNotificationShown","description","kind","title","onunhandledrejection","event","_event_reason","reason"],"sourceRoot":""}
1
+ {"version":3,"file":"openmrs-esm-error-handling.js","mappings":"8MAAAA,EAAOC,QAAUC,C,GCCbC,EAA2B,CAAC,EAGhC,SAASC,EAAoBC,GAE5B,IAAIC,EAAeH,EAAyBE,GAC5C,QAAqBE,IAAjBD,EACH,OAAOA,EAAaL,QAGrB,IAAID,EAASG,EAAyBE,GAAY,CAGjDJ,QAAS,CAAC,GAOX,OAHAO,EAAoBH,GAAUL,EAAQA,EAAOC,QAASG,GAG/CJ,EAAOC,OACf,CCrBAG,EAAoBK,EAAI,CAACR,EAASS,KACjC,IAAI,IAAIC,KAAOD,EACXN,EAAoBQ,EAAEF,EAAYC,KAASP,EAAoBQ,EAAEX,EAASU,IAC5EE,OAAOC,eAAeb,EAASU,EAAK,CAAEI,YAAY,EAAMC,IAAKN,EAAWC,IAE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@openmrs/esm-error-handling/external system \"@openmrs/esm-globals\"","webpack://@openmrs/esm-error-handling/webpack/bootstrap","webpack://@openmrs/esm-error-handling/webpack/runtime/define property getters","webpack://@openmrs/esm-error-handling/webpack/runtime/hasOwnProperty shorthand","webpack://@openmrs/esm-error-handling/webpack/runtime/make namespace object","webpack://@openmrs/esm-error-handling/./src/index.ts"],"sourcesContent":["module.exports = __WEBPACK_EXTERNAL_MODULE__728__;","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// define __esModule on exports\n__webpack_require__.r = (exports) => {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","/** @module @category Error Handling */\nimport { dispatchNotificationShown } from \"@openmrs/esm-globals\";\n\nwindow.onerror = function (error) {\n console.error(\"Unexpected error: \", error);\n dispatchNotificationShown({\n description: error ?? \"Oops! An unexpected error occurred.\",\n kind: \"error\",\n title: \"Error\",\n });\n return false;\n};\n\nwindow.onunhandledrejection = function (event) {\n console.error(\"Unhandled rejection: \", event.reason);\n dispatchNotificationShown({\n description:\n event.reason ?? \"Oops! An unhandled promise rejection occurred.\",\n kind: \"error\",\n title: \"Error\",\n });\n};\n\nexport function reportError(err) {\n const error = ensureErrorObject(err);\n setTimeout(() => {\n throw error;\n });\n}\n\nexport function createErrorHandler() {\n const outgoingErr = Error();\n return (incomingErr) => {\n const finalErr = ensureErrorObject(incomingErr);\n finalErr.stack += `\\nAsync stacktrace:\\n${outgoingErr.stack}`;\n reportError(incomingErr);\n };\n}\n\nfunction ensureErrorObject(thing: any) {\n let message;\n\n if (thing instanceof Error) {\n return thing;\n } else if (thing === null) {\n return Error(`'null' was thrown as an error`);\n } else if (typeof thing === \"object\") {\n try {\n message = `Object thrown as error: ${JSON.stringify(thing)}`;\n } catch (e) {\n message = `Object thrown as error with the following properties: ${Object.keys(\n thing\n )}`;\n }\n return Error(message);\n } else if (thing === undefined) {\n return Error(`'undefined' was thrown as an error`);\n } else {\n return Error(thing.toString());\n }\n}\n"],"names":["module","exports","__WEBPACK_EXTERNAL_MODULE__728__","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","undefined","__webpack_modules__","d","definition","key","o","Object","defineProperty","enumerable","get","obj","prop","prototype","hasOwnProperty","call","r","Symbol","toStringTag","value","reportError","err","error","ensureErrorObject","setTimeout","createErrorHandler","outgoingErr","Error","incomingErr","stack","thing","message","JSON","stringify","e","keys","toString","window","onerror","console","dispatchNotificationShown","description","kind","title","onunhandledrejection","event","reason"],"sourceRoot":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-error-handling",
3
- "version": "5.0.3-pre.826",
3
+ "version": "5.0.3-pre.829",
4
4
  "license": "MPL-2.0",
5
5
  "description": "An ES module to help with error handling",
6
6
  "browser": "dist/openmrs-esm-error-handling.js",
@@ -40,7 +40,7 @@
40
40
  "@openmrs/esm-globals": "4.x"
41
41
  },
42
42
  "devDependencies": {
43
- "@openmrs/esm-globals": "^5.0.3-pre.826"
43
+ "@openmrs/esm-globals": "^5.0.3-pre.829"
44
44
  },
45
- "gitHead": "d0bef414e7decaaa709644212c6cfd50c62c211f"
45
+ "gitHead": "9bab50b6efe1f74e6964adbce112fc0c8a67f2e6"
46
46
  }
package/webpack.config.js CHANGED
@@ -18,7 +18,7 @@ module.exports = (env) => ({
18
18
  {
19
19
  test: /\.m?(js|ts|tsx)$/,
20
20
  exclude: /node_modules/,
21
- use: "@swc-node/loader",
21
+ use: "swc-loader",
22
22
  },
23
23
  ],
24
24
  },