Commit 24bdfda8 authored by tom's avatar tom

get status code from error obj while handling uncaught error

parent 130fe7a0
......@@ -2,6 +2,7 @@ import { chakra } from '@chakra-ui/react';
import React from 'react';
import getErrorCauseStatusCode from 'lib/errors/getErrorCauseStatusCode';
import getErrorObjStatusCode from 'lib/errors/getErrorObjStatusCode';
import { useRollbar } from 'lib/rollbar';
import ErrorBoundary from 'ui/shared/ErrorBoundary';
......@@ -26,7 +27,7 @@ const AppErrorBoundary = ({ className, children, Container }: Props) => {
}, [ className, Container ]);
const handleError = React.useCallback((error: Error) => {
const statusCode = getErrorCauseStatusCode(error);
const statusCode = getErrorCauseStatusCode(error) || getErrorObjStatusCode(error);
if (statusCode || !rollbar) {
// For now, we are not interested in logging errors from the API.
// If an error from a resource should be logged, please consider passing "logError: true" to the useApiQuery or useApiFetch hook.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment