123456789101112131415161718192021222324 |
- import { isError } from '@sentry/utils';
- /**
- * Determines whether input is a Next.js not-found error.
- * https://beta.nextjs.org/docs/api-reference/notfound#notfound
- */
- function isNotFoundNavigationError(subject) {
- return isError(subject) && (subject ).digest === 'NEXT_NOT_FOUND';
- }
- /**
- * Determines whether input is a Next.js redirect error.
- * https://beta.nextjs.org/docs/api-reference/redirect#redirect
- */
- function isRedirectNavigationError(subject) {
- return (
- isError(subject) &&
- typeof (subject ).digest === 'string' &&
- (subject ).digest.startsWith('NEXT_REDIRECT;') // a redirect digest looks like "NEXT_REDIRECT;[redirect path]"
- );
- }
- export { isNotFoundNavigationError, isRedirectNavigationError };
- //# sourceMappingURL=nextNavigationErrorUtils.js.map
|