Skip to content

Commit 2001287

Browse files
committed
feat(shared,types): Add clerk trace id to existing errors
1 parent 6ea39ae commit 2001287

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

packages/shared/src/errors/parseError.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export function parseError(error: ClerkAPIErrorJSON): ClerkAPIError {
1919
code: error.code,
2020
message: error.message,
2121
longMessage: error.long_message,
22+
clerkTraceId: error.clerk_trace_id,
2223
meta: {
2324
paramName: error?.meta?.param_name,
2425
sessionId: error?.meta?.session_id,

packages/types/src/api.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ export interface ClerkAPIError {
1414
* A more detailed message that describes the error.
1515
*/
1616
longMessage?: string;
17+
/**
18+
* A trace ID that can be used to identify the error in the Clerk API logs.
19+
*/
20+
clerkTraceId?: string;
1721
/**
1822
* Additional information about the error.
1923
*/

packages/types/src/json.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -363,6 +363,7 @@ export interface ClerkAPIErrorJSON {
363363
code: string;
364364
message: string;
365365
long_message?: string;
366+
clerk_trace_id?: string;
366367
meta?: {
367368
param_name?: string;
368369
session_id?: string;

0 commit comments

Comments
 (0)