|
1 | 1 | import type { ClerkAPIResponseError } from './clerkApiResponseError'; |
| 2 | +import { isClerkAPIResponseError } from './clerkApiResponseError'; |
2 | 3 | import type { ClerkRuntimeError } from './clerkRuntimeError'; |
| 4 | +import { isClerkRuntimeError } from './clerkRuntimeError'; |
3 | 5 | import type { EmailLinkError } from './emailLinkError'; |
4 | 6 | import type { MetamaskError } from './metamaskError'; |
5 | 7 |
|
@@ -55,35 +57,6 @@ export function isKnownError(error: any): error is ClerkAPIResponseError | Clerk |
55 | 57 | return isClerkAPIResponseError(error) || isMetamaskError(error) || isClerkRuntimeError(error); |
56 | 58 | } |
57 | 59 |
|
58 | | -/** |
59 | | - * Checks if the provided error is a ClerkAPIResponseError. |
60 | | - * |
61 | | - * @internal |
62 | | - */ |
63 | | -export function isClerkAPIResponseError(err: any): err is ClerkAPIResponseError { |
64 | | - return err && 'clerkError' in err; |
65 | | -} |
66 | | - |
67 | | -/** |
68 | | - * Checks if the provided error object is an instance of ClerkRuntimeError. |
69 | | - * |
70 | | - * @param err - The error object to check. |
71 | | - * @returns True if the error is a ClerkRuntimeError, false otherwise. |
72 | | - * |
73 | | - * @example |
74 | | - * const error = new ClerkRuntimeError('An error occurred'); |
75 | | - * if (isClerkRuntimeError(error)) { |
76 | | - * // Handle ClerkRuntimeError |
77 | | - * console.error('ClerkRuntimeError:', error.message); |
78 | | - * } else { |
79 | | - * // Handle other errors |
80 | | - * console.error('Other error:', error.message); |
81 | | - * } |
82 | | - */ |
83 | | -export function isClerkRuntimeError(err: any): err is ClerkRuntimeError { |
84 | | - return 'clerkRuntimeError' in err; |
85 | | -} |
86 | | - |
87 | 60 | /** |
88 | 61 | * Checks if the provided error is a Clerk runtime error indicating a reverification was cancelled. |
89 | 62 | * |
|
0 commit comments