All Downloads are FREE. Search and download functionalities are using the official Maven repository.

package.cjs.react-utils.HoneybadgerErrorBoundary.HoneybadgerErrorBoundary.js.map Maven / Gradle / Ivy

Go to download

A package encapsulating common code across neeto projects including initializers, utility functions, common components and hooks and so on.

There is a newer version: 4.12.3
Show newest version
{"version":3,"file":"HoneybadgerErrorBoundary.js","names":["_react","require","_constants","_FallbackComponent","_interopRequireDefault","_utils","_jsxRuntime","HoneybadgerErrorBoundary","_ref","children","_ref$ErrorComponent","ErrorComponent","FallbackComponent","_ref$filterErrors","filterErrors","undefined","Honeybadger","beforeNotify","notice","_globalProps$user","isIgnorable","IGNORABLE_ERRORS_REGEX","test","message","IGNORABLE_ERROR_NAMES_REGEX","name","stack","includes","context","errorClass","isChunkLoadError","user","globalProps","email","sessionReplay","getSessionReplayUrl","attachContext","honeybadger","configure","apiKey","honeybadgerApiKey","environment","railsEnv","revision","honeybadgerRevision","developmentEnvironments","enableUncaught","async","breadcrumbsEnabled","projectRoot","enableUnhandledRejection","jsx","_default","exports"],"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,IAAAA,MAAA,GAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAD,OAAA;AAIA,IAAAE,kBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AAA6D,IAAAK,WAAA,GAAAL,OAAA;AAE7D,0EACA,IAAMM,wBAAwB,GAAG,SAA3BA,wBAAwBA,CAAAC,IAAA,EAIxB;EAAA,IAHJC,QAAQ,GAAAD,IAAA,CAARC,QAAQ;IAAAC,mBAAA,GAAAF,IAAA,CACRG,cAAc;IAAdA,cAAc,GAAAD,mBAAA,cAAGE,6BAAiB,GAAAF,mBAAA;IAAAG,iBAAA,GAAAL,IAAA,CAClCM,YAAY;IAAZA,YAAY,GAAAD,iBAAA,cAAGE,SAAS,GAAAF,iBAAA;EAExBG,kBAAW,CAACC,YAAY,CAAC,UAAAC,MAAM,EAAI;IAAA,IAAAC,iBAAA;IACjC,IAAI,CAACD,MAAM,EAAE,OAAO,KAAK;IAEz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