@sourceregistry/sveltekit-enhance 1.4.0 → 1.4.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -9,6 +9,7 @@ export type RequestTraceLocals = {
9
9
  export type RecordTraceMetricEntry = {
10
10
  method: string;
11
11
  path: string;
12
+ url: URL;
12
13
  status: number;
13
14
  durationMs: number;
14
15
  };
@@ -30,6 +30,7 @@ export const RequestMonitor = {
30
30
  record?.({
31
31
  method: event.request.method,
32
32
  path: route,
33
+ url: event.url,
33
34
  status: response.status,
34
35
  durationMs: elapsedMs,
35
36
  });
@@ -37,6 +38,7 @@ export const RequestMonitor = {
37
38
  request_id: requestId,
38
39
  method: event.request.method,
39
40
  route,
41
+ url: event.url.toString(),
40
42
  status: response.status,
41
43
  duration_ms: elapsedMs,
42
44
  client_ip: event?.getClientAddress?.()
@@ -57,6 +59,7 @@ export const RequestMonitor = {
57
59
  record?.({
58
60
  method: event.request.method,
59
61
  path: route,
62
+ url: event.url,
60
63
  status: 500,
61
64
  durationMs: elapsedMs,
62
65
  });
@@ -64,11 +67,12 @@ export const RequestMonitor = {
64
67
  request_id: requestId,
65
68
  method: event.request.method,
66
69
  route,
70
+ url: event.url,
67
71
  duration_ms: elapsedMs,
68
72
  client_ip: event?.getClientAddress?.(),
69
73
  error: error instanceof Error
70
74
  ? { name: error.name, message: error.message }
71
- : { value: String(error) }
75
+ : { value: await Promise.resolve(JSON.stringify(error)).catch(() => String(error)) }
72
76
  });
73
77
  throw error;
74
78
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sourceregistry/sveltekit-enhance",
3
- "version": "1.4.0",
3
+ "version": "1.4.2",
4
4
  "description": "Composable enhance and form utilities for SvelteKit actions, loads, methods, and hooks.",
5
5
  "author": "A.P.A. Slaa (a.p.a.slaa@projectsource.nl)",
6
6
  "scripts": {