Skip to content

Commit

Permalink
read status from error
Browse files Browse the repository at this point in the history
  • Loading branch information
huozhi committed Nov 15, 2024
1 parent 218129d commit 4db8f00
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@

import React, { useContext } from 'react'
import { useUntrackedPathname } from '../navigation-untracked'
import { isHTTPAccessFallbackError } from './http-access-fallback'
import {
getAccessFallbackHTTPStatus,
isHTTPAccessFallbackError,
} from './http-access-fallback'
import { warnOnce } from '../../../shared/lib/utils/warn-once'
import { MissingSlotContext } from '../../../shared/lib/app-router-context.shared-runtime'

Expand Down Expand Up @@ -79,7 +82,7 @@ class HTTPAccessFallbackErrorBoundary extends React.Component<
static getDerivedStateFromError(error: any) {
if (isHTTPAccessFallbackError(error)) {
return {
triggeredStatus: HTTPErrorStatus.NOT_FOUND,
triggeredStatus: getAccessFallbackHTTPStatus(error),
}
}
// Re-throw if error is not for 404
Expand Down

0 comments on commit 4db8f00

Please sign in to comment.