Skip to content

Commit f10358e

Browse files
committed
Client Side Error Reporting: fix httpRequest context
1 parent 44a18d2 commit f10358e

File tree

5 files changed

+17
-12
lines changed

5 files changed

+17
-12
lines changed

src/AffordableMobiles/GServerlessSupportLaravel/Integration/ErrorReporting/ClientSideJavaScript/Http/Controllers/ErrorReporterController.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ public function report(Request $request): JsonResponse
5757
'stack_trace_frames.*.line_number' => 'nullable|integer',
5858
'stack_trace_frames.*.column_number' => 'nullable|integer',
5959
'context' => 'nullable|array',
60+
'context.httpRequest' => 'nullable|array',
61+
'context.httpRequest.url' => 'nullable|string',
62+
'context.httpRequest.userAgent' => 'nullable|string',
6063
]);
6164

6265
$traceId = $validated['traceId'];

src/resources/js/dist/.vite/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"src/resources/js/error-reporter.js": {
3-
"file": "error-reporter.llYQMYLD.js",
3+
"file": "error-reporter.Cxn0tNpj.js",
44
"name": "error-reporter",
55
"src": "src/resources/js/error-reporter.js",
66
"isEntry": true

src/resources/js/dist/error-reporter.llYQMYLD.js renamed to src/resources/js/dist/error-reporter.Cxn0tNpj.js

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/resources/js/dist/error-reporter.llYQMYLD.js.map renamed to src/resources/js/dist/error-reporter.Cxn0tNpj.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/resources/js/error-reporter.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -72,15 +72,17 @@ const errorReporter = {
7272
},
7373
traceId: this.config.traceId,
7474
stack_trace_frames: stackFrames.map(sf => ({
75-
function_name: isValidFunctionName(sf.functionName) ? sf.functionName : null,
76-
file_name: sf.fileName,
77-
line_number: sf.lineNumber,
78-
column_number: sf.columnNumber,
75+
function_name: isValidFunctionName(sf.functionName) ? sf.functionName : null,
76+
file_name: sf.fileName,
77+
line_number: sf.lineNumber,
78+
column_number: sf.columnNumber,
7979
})),
8080
context: {
8181
...this.config.context,
82-
url: window.location.href,
83-
userAgent: navigator.userAgent,
82+
"httpRequest": {
83+
"url": window.location.href,
84+
"userAgent": navigator.userAgent,
85+
},
8486
},
8587
};
8688
},

0 commit comments

Comments
 (0)