Skip to content

Commit 24406b9

Browse files
authored
Merge pull request #152 from codex-team/fix/catcher-context-and-fetch-fail-status
fix(js-catcher): allow optional context and set statusCode on fetch fail
2 parents cc3f317 + 51cc9d4 commit 24406b9

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

packages/javascript/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@hawk.so/javascript",
3-
"version": "3.2.13",
3+
"version": "3.2.14",
44
"description": "JavaScript errors tracking for Hawk.so",
55
"files": [
66
"dist"

packages/javascript/src/addons/breadcrumbs.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,6 +403,7 @@ export class BreadcrumbManager {
403403
data: {
404404
url,
405405
method,
406+
statusCode: 0,
406407
durationMs: duration,
407408
error: error instanceof Error ? error.message : String(error),
408409
},

packages/javascript/src/utils/validation.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export function validateUser(user: AffectedUser): boolean {
3030
* @param context
3131
*/
3232
export function validateContext(context: EventContext | undefined): boolean {
33-
if (!context || !Sanitizer.isObject(context)) {
33+
if (context && !Sanitizer.isObject(context)) {
3434
log('validateContext: Context must be an object', 'warn');
3535

3636
return false;

0 commit comments

Comments
 (0)