{"ast":null,"code":"var isErrorHandlingEnabled = true;\nvar developmentBuildMessage = \"If you're trying to use a module that is not supported in Expo Go, you need to create a development build of your app. See https://docs.expo.dev/development/introduction/ for more info.\";\nfunction customizeUnavailableMessage(error) {\n  error.message += '\\n\\n' + developmentBuildMessage;\n}\nfunction customizeModuleIsMissingMessage(error) {\n  error.message = \"Your JavaScript code tried to access a native module that doesn't exist. \\n\\n\" + developmentBuildMessage;\n}\nfunction customizeError(error) {\n  if ('code' in error && error.code === 'ERR_UNAVAILABLE') {\n    customizeUnavailableMessage(error);\n  } else if (error.message.includes('Native module cannot be null') || error.message.includes('`new NativeEventEmitter()` requires a non-null argument.')) {\n    customizeModuleIsMissingMessage(error);\n  }\n}\nfunction errorHandler(originalHandler, error, isFatal) {\n  if (error instanceof Error) {\n    customizeError(error);\n  }\n  originalHandler(error, isFatal);\n}\nexport function createErrorHandler(originalHandler) {\n  return function (error, isFatal) {\n    if (isErrorHandlingEnabled) {\n      errorHandler(originalHandler, error, isFatal);\n      return;\n    }\n    originalHandler(error, isFatal);\n  };\n}\nexport function disableErrorHandling() {\n  isErrorHandlingEnabled = false;\n}","map":{"version":3,"sources":["../../src/errors/ExpoErrorManager.ts"],"names":[],"mappings":"AAGA,IAAI,sBAAsB,GAAG,IAAI;AAEjC,IAAM,uBAAuB,8LAA8L;AAE3N,SAAS,2BAA2B,CAAC,KAAiB,EAAA;EACpD,KAAK,CAAC,OAAO,IAAI,MAAM,GAAG,uBAAuB;AACnD;AAEA,SAAS,+BAA+B,CAAC,KAAY,EAAA;EACnD,KAAK,CAAC,OAAO,qFAEb,uBAAyB;AAC3B;AAEA,SAAS,cAAc,CAAC,KAAyB,EAAA;EAC/C,IAAI,MAAM,IAAI,KAAK,IAAI,KAAK,CAAC,IAAI,KAAK,iBAAiB,EAAE;IACvD,2BAA2B,CAAC,KAAK,CAAC;GACnC,MAAM,IACL,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,8BAA8B,CAAC,IACtD,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,0DAA0D,CAAC,EAClF;IACA,+BAA+B,CAAC,KAAK,CAAC;EACvC;AACH;AAEA,SAAS,YAAY,CAAC,eAAe,EAAE,KAAK,EAAE,OAAO,EAAA;EACnD,IAAI,KAAK,YAAY,KAAK,EAAE;IAC1B,cAAc,CAAC,KAAK,CAAC;EACtB;EACD,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC;AACjC;AAEA,OAAM,SAAU,kBAAkB,CAAC,eAAe,EAAA;EAChD,OAAO,UAAC,KAAK,EAAE,OAAO,EAAI;IACxB,IAAI,sBAAsB,EAAE;MAC1B,YAAY,CAAC,eAAe,EAAE,KAAK,EAAE,OAAO,CAAC;MAC7C;IACD;IAED,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC;EACjC,CAAC;AACH;AAEA,OAAM,SAAU,oBAAoB,CAAA,EAAA;EAClC,sBAAsB,GAAG,KAAK;AAChC","sourcesContent":["// Similar interface to the one used in expo modules.\ntype CodedError = Error & { code?: string };\n\nlet isErrorHandlingEnabled = true;\n\nconst developmentBuildMessage = `If you're trying to use a module that is not supported in Expo Go, you need to create a development build of your app. See https://docs.expo.dev/development/introduction/ for more info.`;\n\nfunction customizeUnavailableMessage(error: CodedError) {\n  error.message += '\\n\\n' + developmentBuildMessage;\n}\n\nfunction customizeModuleIsMissingMessage(error: Error) {\n  error.message = `Your JavaScript code tried to access a native module that doesn't exist. \n\n${developmentBuildMessage}`;\n}\n\nfunction customizeError(error: Error | CodedError) {\n  if ('code' in error && error.code === 'ERR_UNAVAILABLE') {\n    customizeUnavailableMessage(error);\n  } else if (\n    error.message.includes('Native module cannot be null') || // RN 0.64 and below message\n    error.message.includes('`new NativeEventEmitter()` requires a non-null argument.') // RN 0.65+ message\n  ) {\n    customizeModuleIsMissingMessage(error);\n  }\n}\n\nfunction errorHandler(originalHandler, error, isFatal) {\n  if (error instanceof Error) {\n    customizeError(error);\n  }\n  originalHandler(error, isFatal);\n}\n\nexport function createErrorHandler(originalHandler) {\n  return (error, isFatal) => {\n    if (isErrorHandlingEnabled) {\n      errorHandler(originalHandler, error, isFatal);\n      return;\n    }\n\n    originalHandler(error, isFatal);\n  };\n}\n\nexport function disableErrorHandling() {\n  isErrorHandlingEnabled = false;\n}\n"],"sourceRoot":""},"metadata":{},"sourceType":"module"}