Skip to content

Commit e11807c

Browse files
committed
drop it instead
1 parent d3e9a08 commit e11807c

File tree

2 files changed

+4
-41
lines changed

2 files changed

+4
-41
lines changed

packages/remix/src/server/errors.ts

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
import type {
2-
ActionFunction,
3-
ActionFunctionArgs,
4-
EntryContext,
5-
HandleDocumentRequestFunction,
6-
LoaderFunction,
7-
LoaderFunctionArgs,
8-
} from '@remix-run/node';
1+
import type { ActionFunction, ActionFunctionArgs, LoaderFunction, LoaderFunctionArgs } from '@remix-run/node';
92
import { isRouteErrorResponse } from '@remix-run/router';
103
import type { RequestEventData, Span } from '@sentry/core';
114
import {
@@ -79,36 +72,6 @@ export async function captureRemixServerException(err: unknown, name: string, re
7972
});
8073
}
8174

82-
/**
83-
* Wraps the original `HandleDocumentRequestFunction` with error handling.
84-
*
85-
* @param origDocumentRequestFunction The original `HandleDocumentRequestFunction`.
86-
* @param requestContext The request context.
87-
*
88-
* @returns The wrapped `HandleDocumentRequestFunction`.
89-
*/
90-
export function errorHandleDocumentRequestFunction(
91-
this: unknown,
92-
origDocumentRequestFunction: HandleDocumentRequestFunction,
93-
requestContext: {
94-
request: Request;
95-
responseStatusCode: number;
96-
responseHeaders: Headers;
97-
context: EntryContext;
98-
loadContext?: Record<string, unknown>;
99-
},
100-
): HandleDocumentRequestFunction {
101-
const { request, responseStatusCode, responseHeaders, context, loadContext } = requestContext;
102-
103-
return handleCallbackErrors(
104-
() => origDocumentRequestFunction.call(this, request, responseStatusCode, responseHeaders, context, loadContext),
105-
err => {
106-
// eslint-disable-next-line @typescript-eslint/no-floating-promises
107-
captureRemixServerException(err, 'HandleDocumentRequestFunction', request);
108-
},
109-
);
110-
}
111-
11275
/**
11376
* Wraps the original `DataFunction` with error handling.
11477
* This function also stores the form data keys if the action is being called.

packages/remix/src/server/instrumentServer.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ import {
3939
import { DEBUG_BUILD } from '../utils/debug-build';
4040
import { createRoutes, getTransactionName } from '../utils/utils';
4141
import { extractData, isResponse, json } from '../utils/vendor/response';
42-
import { captureRemixServerException, errorHandleDataFunction, errorHandleDocumentRequestFunction } from './errors';
42+
import { captureRemixServerException, errorHandleDataFunction } from './errors';
4343

4444
type AppData = unknown;
4545
type RemixRequest = Parameters<RequestHandler>[0];
@@ -155,11 +155,11 @@ function makeWrappedDocumentRequestFunction(instrumentTracing?: boolean) {
155155
},
156156
},
157157
() => {
158-
return errorHandleDocumentRequestFunction.call(this, origDocumentRequestFunction, documentRequestContext);
158+
return origDocumentRequestFunction.call(this, documentRequestContext);
159159
},
160160
);
161161
} else {
162-
return errorHandleDocumentRequestFunction.call(this, origDocumentRequestFunction, documentRequestContext);
162+
return origDocumentRequestFunction.call(this, documentRequestContext);
163163
}
164164
};
165165
};

0 commit comments

Comments
 (0)