{"version":3,"file":"errors.53cc48f6.js","sources":["../../../frontend/features/common/utils/errors.js"],"sourcesContent":["/* eslint-disable max-classes-per-file */\nimport * as Sentry from '@sentry/browser';\n\n// Utilities\nimport { featureFlagEnabled } from 'common/utils/helpers';\n\n// log errors\nexport const logError = (error, context = {}) => {\n Object.entries(context).forEach((entries) => {\n const [key, value] = entries;\n Sentry.setContext(key, value);\n });\n Sentry.captureException(error);\n if (featureFlagEnabled('sentry-feedback-modal')) {\n Sentry.showReportDialog();\n }\n};\n\nexport class InvalidGeoJsonError extends Error {\n constructor() {\n super('Error: Not a valid GeoJSON');\n }\n}\nexport class UnsupportedFeaturesError extends Error {\n /**\n * @param {string[]} features - The list of supported features.\n */\n constructor(features) {\n super(`Warning: All features except ${features} will be ignored`);\n }\n}\n\nexport class NoSupportedFeaturesError extends Error {\n /**\n * @param {string[]} features - The list of supported features.\n */\n constructor(features) {\n super(\n `There are no supported features in your GeoJSON. Only supported features are ${features}`\n );\n }\n}\n"],"names":["logError","error","context","entries","key","value","Sentry.setContext","Sentry.captureException","featureFlagEnabled","Sentry.showReportDialog","InvalidGeoJsonError","UnsupportedFeaturesError","features","NoSupportedFeaturesError"],"mappings":"0cAOO,MAAMA,EAAW,CAACC,EAAOC,EAAU,KAAO,CAC/C,OAAO,QAAQA,CAAO,EAAE,QAASC,GAAY,CACrC,KAAA,CAACC,EAAKC,CAAK,EAAIF,EACdG,EAAWF,EAAKC,CAAK,CAAA,CAC7B,EACDE,EAAwBN,CAAK,EACzBO,EAAmB,uBAAuB,GAC5CC,GAEJ,EAEO,MAAMC,UAA4B,KAAM,CAC7C,aAAc,CACZ,MAAM,4BAA4B,CACpC,CACF,CACO,MAAMC,UAAiC,KAAM,CAIlD,YAAYC,EAAU,CACpB,MAAM,gCAAgCA,mBAA0B,CAClE,CACF,CAEO,MAAMC,UAAiC,KAAM,CAIlD,YAAYD,EAAU,CACpB,MACE,gFAAgFA,GAAA,CAEpF,CACF"}