Skip to content

Commit 2891fbc

Browse files
committed
Remove uneccesary Error | unknown typing
1 parent 0cf1ae0 commit 2891fbc

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

.changeset/on-unhandled-error.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Add optional `onUnhandledError` export for custom server-side error processing.
77
```ts
88
// entry.server.tsx
99
export function onUnhandledError(
10-
error: Error | unknown,
10+
error: unknown,
1111
{ request, params, context }: DataFunctionArgs
1212
): void {
1313
if (error instanceof Error) {

docs/file-conventions/entry.server.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ By default, Remix will log encountered server-side errors to the console. If you
2929

3030
```tsx
3131
export function onUnhandledError(
32-
error: Error | unknown,
32+
error: unknown,
3333
{ request, params, context }: DataFunctionArgs
3434
) {
3535
sendErrorToErrorReportingService(error);

integration/error-sanitization-test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,7 +464,7 @@ test.describe("Error Sanitization", () => {
464464
}
465465
466466
export function onUnhandledError(
467-
error: Error | unknown,
467+
error: unknown,
468468
{ request }: { request: Request },
469469
) {
470470
console.error("App Specific Error Logging:");

packages/remix-server-runtime/build.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export interface HandleDataRequestFunction {
3333
}
3434

3535
export interface OnUnhandledErrorFunction {
36-
(error: Error | unknown, args: DataFunctionArgs): void;
36+
(error: unknown, args: DataFunctionArgs): void;
3737
}
3838

3939
/**

packages/remix-server-runtime/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ async function handleDataRequestRR(
130130
routeId: string,
131131
request: Request,
132132
loadContext: AppLoadContext,
133-
handleError: (err: Error | unknown) => void
133+
handleError: (err: unknown) => void
134134
) {
135135
try {
136136
let response = await staticHandler.queryRoute(request, {

0 commit comments

Comments
 (0)