chore(dependencies): update package versions for improved compatibility (#332)
This commit is contained in:
committed by
GitHub
parent
f9ebe2f927
commit
9ce150609e
@@ -18,13 +18,26 @@ export async function register() {
|
||||
* @name onRequestError
|
||||
* @description This function is called when an error occurs during the request lifecycle.
|
||||
* It is used to capture the error and send it to the monitoring service.
|
||||
* @param err
|
||||
*/
|
||||
export const onRequestError: Instrumentation.onRequestError = async (err) => {
|
||||
export const onRequestError: Instrumentation.onRequestError = async (
|
||||
err,
|
||||
request,
|
||||
context,
|
||||
) => {
|
||||
const { getServerMonitoringService } = await import('@kit/monitoring/server');
|
||||
|
||||
const service = await getServerMonitoringService();
|
||||
|
||||
await service.ready();
|
||||
await service.captureException(err as Error);
|
||||
|
||||
await service.captureException(
|
||||
err as Error,
|
||||
{},
|
||||
{
|
||||
path: request.path,
|
||||
headers: request.headers,
|
||||
method: request.method,
|
||||
routePath: context.routePath,
|
||||
},
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user