Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
24bdfda8
Commit
24bdfda8
authored
Jan 14, 2025
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
get status code from error obj while handling uncaught error
parent
130fe7a0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
AppErrorBoundary.tsx
ui/shared/AppError/AppErrorBoundary.tsx
+2
-1
No files found.
ui/shared/AppError/AppErrorBoundary.tsx
View file @
24bdfda8
...
@@ -2,6 +2,7 @@ import { chakra } from '@chakra-ui/react';
...
@@ -2,6 +2,7 @@ import { chakra } from '@chakra-ui/react';
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
getErrorCauseStatusCode
from
'
lib/errors/getErrorCauseStatusCode
'
;
import
getErrorCauseStatusCode
from
'
lib/errors/getErrorCauseStatusCode
'
;
import
getErrorObjStatusCode
from
'
lib/errors/getErrorObjStatusCode
'
;
import
{
useRollbar
}
from
'
lib/rollbar
'
;
import
{
useRollbar
}
from
'
lib/rollbar
'
;
import
ErrorBoundary
from
'
ui/shared/ErrorBoundary
'
;
import
ErrorBoundary
from
'
ui/shared/ErrorBoundary
'
;
...
@@ -26,7 +27,7 @@ const AppErrorBoundary = ({ className, children, Container }: Props) => {
...
@@ -26,7 +27,7 @@ const AppErrorBoundary = ({ className, children, Container }: Props) => {
},
[
className
,
Container
]);
},
[
className
,
Container
]);
const
handleError
=
React
.
useCallback
((
error
:
Error
)
=>
{
const
handleError
=
React
.
useCallback
((
error
:
Error
)
=>
{
const
statusCode
=
getErrorCauseStatusCode
(
error
);
const
statusCode
=
getErrorCauseStatusCode
(
error
)
||
getErrorObjStatusCode
(
error
)
;
if
(
statusCode
||
!
rollbar
)
{
if
(
statusCode
||
!
rollbar
)
{
// For now, we are not interested in logging errors from the API.
// 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.
// If an error from a resource should be logged, please consider passing "logError: true" to the useApiQuery or useApiFetch hook.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment