MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / isRedirect

Function isRedirect

packages/sveltekit/src/common/utils.ts:50–58  ·  view source on GitHub ↗
(error: unknown)

Source from the content-addressed store, hash-verified

48 * @param error the potential redirect error
49 */
50export function isRedirect(error: unknown): error is Redirect {
51 if (error == null || typeof error !== 'object') {
52 return false;
53 }
54 const hasValidLocation = 'location' in error && typeof error.location === 'string';
55 const hasValidStatus =
56 'status' in error && typeof error.status === 'number' && error.status >= 300 && error.status <= 308;
57 return hasValidLocation && hasValidStatus;
58}
59
60/**
61 * Determines if a thrown "error" is a HttpError

Callers 3

utils.test.tsFile · 0.90
sendErrorToSentryFunction · 0.90
sendErrorToSentryFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected