Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/good-toys-serve.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@clerk/shared': patch
'@clerk/types': patch
---

Export `ClerkAPIResponseError` interface from types package.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ exports[`Typedoc output > should have a deliberate file structure 1`] = `
"types/check-authorization-params-from-session-claims.mdx",
"types/check-authorization-with-custom-permissions.mdx",
"types/clerk-api-error.mdx",
"types/clerk-api-response-error.mdx",
"types/clerk-host-router.mdx",
"types/clerk-jwt-claims.mdx",
"types/clerk-paginated-response.mdx",
Expand Down
4 changes: 2 additions & 2 deletions integration/tests/session-tasks-sign-in.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withSessionTasks] })(
await app.teardown();
});

test('with email and password, navigate to task on after sign-in', async ({ page, context }) => {
test.skip('with email and password, navigate to task on after sign-in', async ({ page, context }) => {
const u = createTestUtils({ app, page, context });

// Performs sign-in
Expand All @@ -51,7 +51,7 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withSessionTasks] })(
await u.page.waitForAppUrl('/');
});

test('with sso, navigate to task on after sign-in', async ({ page, context }) => {
test.skip('with sso, navigate to task on after sign-in', async ({ page, context }) => {
const u = createTestUtils({ app, page, context });

// Create a clerkClient for the OAuth provider instance
Expand Down
4 changes: 2 additions & 2 deletions integration/tests/session-tasks-sign-up.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withSessionTasks] })(
await app.teardown();
});

test('navigate to task on after sign-up', async ({ page, context }) => {
test.skip('navigate to task on after sign-up', async ({ page, context }) => {
// Performs sign-up
const u = createTestUtils({ app, page, context });
await u.po.signUp.goTo();
Expand All @@ -53,7 +53,7 @@ testAgainstRunningApps({ withEnv: [appConfigs.envs.withSessionTasks] })(
await u.page.waitForAppUrl('/');
});

test('with sso, navigate to task on after sign-up', async ({ page, context }) => {
test.skip('with sso, navigate to task on after sign-up', async ({ page, context }) => {
const u = createTestUtils({ app, page, context });

// Create a clerkClient for the OAuth provider instance
Expand Down
8 changes: 6 additions & 2 deletions packages/shared/src/error.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import type { ClerkAPIError, ClerkAPIErrorJSON } from '@clerk/types';
import type {
ClerkAPIError,
ClerkAPIErrorJSON,
ClerkAPIResponseError as ClerkAPIResponseErrorInterface,
} from '@clerk/types';

export function isUnauthorizedError(e: any): boolean {
const status = e?.status;
Expand Down Expand Up @@ -116,7 +120,7 @@ export function errorToJSON(error: ClerkAPIError | null): ClerkAPIErrorJSON {
};
}

export class ClerkAPIResponseError extends Error {
export class ClerkAPIResponseError extends Error implements ClerkAPIResponseErrorInterface {
clerkError: true;

status: number;
Expand Down
12 changes: 12 additions & 0 deletions packages/types/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,3 +43,15 @@ export interface ClerkRuntimeError {
code: string;
message: string;
}

/**
* Interface representing a Clerk API Response Error.
*/
export interface ClerkAPIResponseError extends Error {
clerkError: true;
status: number;
message: string;
clerkTraceId?: string;
retryAfter?: number;
errors: ClerkAPIError[];
}
Loading