Skip to content

Commit 875dc7f

Browse files
Merge pull request #23 from fingerprintjs/refactor/log_errors
Refactor/log errors
2 parents fe8b3cc + 3f0706b commit 875dc7f

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/utils/createErrorResponse.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,12 @@ export function createErrorResponseForIngress(request: Request, error: string |
6161
'Access-Control-Allow-Credentials': 'true',
6262
'content-type': 'application/json',
6363
}
64+
console.log(`Error occurred for ingress request, reason: ${reason}`)
6465
return new Response(JSON.stringify(responseBody), { status: 500, headers: responseHeaders })
6566
}
6667

6768
export function createFallbackErrorResponse(error: string | Error | unknown): Response {
6869
const responseBody = { error: errorToString(error) }
70+
console.log(`Error occurred, reason: ${responseBody}`)
6971
return new Response(JSON.stringify(responseBody), { status: 500, headers: { 'content-type': 'application/json' } })
7072
}

0 commit comments

Comments
 (0)