package.react-utils.HoneybadgerErrorBoundary.HoneybadgerErrorBoundary.js.map Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of neeto-commons-frontend Show documentation
Show all versions of neeto-commons-frontend Show documentation
A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.
{"version":3,"file":"HoneybadgerErrorBoundary.js","names":["Honeybadger","HoneybadgerErrorBoundary","ErrorBoundary","IGNORABLE_ERROR_NAMES_REGEX","IGNORABLE_ERRORS_REGEX","FallbackComponent","attachContext","getSessionReplayUrl","jsx","_jsx","_ref","children","_ref$ErrorComponent","ErrorComponent","_ref$filterErrors","filterErrors","undefined","beforeNotify","notice","_globalProps$user","isIgnorable","test","message","name","stack","includes","context","errorClass","isChunkLoadError","user","globalProps","email","sessionReplay","honeybadger","configure","apiKey","honeybadgerApiKey","environment","railsEnv","revision","honeybadgerRevision","developmentEnvironments","enableUncaught","async","breadcrumbsEnabled","projectRoot","enableUnhandledRejection"],"sources":["../../../src/react-utils/HoneybadgerErrorBoundary/HoneybadgerErrorBoundary.jsx"],"sourcesContent":["import {\n Honeybadger,\n HoneybadgerErrorBoundary as ErrorBoundary,\n} from \"@honeybadger-io/react\";\n\nimport {\n IGNORABLE_ERROR_NAMES_REGEX,\n IGNORABLE_ERRORS_REGEX,\n} from \"./constants\";\nimport FallbackComponent from \"./FallbackComponent\";\nimport { attachContext, getSessionReplayUrl } from \"./utils\";\n\n/** @type {import(\"neetocommons/react-utils\").HoneybadgerErrorBoundary} */\nconst HoneybadgerErrorBoundary = ({\n children,\n ErrorComponent = FallbackComponent,\n filterErrors = undefined,\n}) => {\n Honeybadger.beforeNotify(notice => {\n if (!notice) return false;\n\n const isIgnorable =\n IGNORABLE_ERRORS_REGEX.test(notice.message) ||\n IGNORABLE_ERROR_NAMES_REGEX.test(notice.name) ||\n notice.stack.includes(\"chrome-extension://\") ||\n filterErrors?.(notice) === false;\n\n if (isIgnorable) return false;\n\n const context = { errorClass: notice.name };\n\n if (notice.name === \"ChunkLoadError\") {\n context.IGNORABLE_ERROR_NAMES_REGEX = IGNORABLE_ERROR_NAMES_REGEX;\n context.isChunkLoadError = IGNORABLE_ERROR_NAMES_REGEX.test(notice.name);\n }\n\n const user = globalProps.user?.email;\n if (user) context.user = user;\n\n const sessionReplay = getSessionReplayUrl();\n if (sessionReplay) context.sessionReplay = sessionReplay;\n\n attachContext(notice, context);\n\n return true;\n });\n\n const honeybadger = Honeybadger.configure({\n apiKey: globalProps.honeybadgerApiKey,\n environment: globalProps.railsEnv,\n revision: globalProps.honeybadgerRevision,\n developmentEnvironments: [\"development\", \"test\"],\n enableUncaught: true,\n async: true,\n breadcrumbsEnabled: true,\n projectRoot: \"webpack:///./\",\n enableUnhandledRejection: false,\n });\n\n return (\n \n {children}\n \n );\n};\n\nexport default HoneybadgerErrorBoundary;\n"],"mappings":"AAAA,SACEA,WAAW,EACXC,wBAAwB,IAAIC,aAAa,QACpC,uBAAuB;AAE9B,SACEC,2BAA2B,EAC3BC,sBAAsB;AAExB,OAAOC,iBAAiB;AACxB,SAASC,aAAa,EAAEC,mBAAmB;;AAE3C;AAAA,SAAAC,GAAA,IAAAC,IAAA;AACA,IAAMR,wBAAwB,GAAG,SAA3BA,wBAAwBA,CAAAS,IAAA,EAIxB;EAAA,IAHJC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAAC,mBAAA,GAAAF,IAAA,CACRG,cAAc;IAAdA,cAAc,GAAAD,mBAAA,cAAGP,iBAAiB,GAAAO,mBAAA;IAAAE,iBAAA,GAAAJ,IAAA,CAClCK,YAAY;IAAZA,YAAY,GAAAD,iBAAA,cAAGE,SAAS,GAAAF,iBAAA;EAExBd,WAAW,CAACiB,YAAY,CAAC,UAAAC,MAAM,EAAI;IAAA,IAAAC,iBAAA;IACjC,IAAI,CAACD,MAAM,EAAE,OAAO,KAAK;IAEzB,IAAME,WAAW,GACfhB,sBAAsB,CAACiB,IAAI,CAACH,MAAM,CAACI,OAAO,CAAC,IAC3CnB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