-
Notifications
You must be signed in to change notification settings - Fork 20
Expand file tree
/
Copy patherror-handler.ts
More file actions
23 lines (18 loc) · 860 Bytes
/
error-handler.ts
File metadata and controls
23 lines (18 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import { LogBox } from "react-native";
LogBox.ignoreLogs([
// TODO: https://forum.moralis.io/t/ethereum-react-native-boilerplate-questions/4511/267
"The provided value 'moz",
// TODO: https://forum.moralis.io/t/ethereum-react-native-boilerplate-questions/4511/267
"The provided value 'ms-stream",
]);
// @ts-expect-error
const errorUtils = global.ErrorUtils;
const defaultErrorHandler = errorUtils.getGlobalHandler();
function customErrorHandler(error: Error, isFatal: boolean): void {
// We need to switch to the ConnectionV2 to solve this issue.
// TODO: https://github.com/WalletConnect/walletconnect-monorepo/issues/1706
if (error.message.includes("PollingBlockTracker - encountered an error while attempting to update latest block"))
return;
defaultErrorHandler(error, isFatal);
}
errorUtils.setGlobalHandler(customErrorHandler);