Skip to content

Commit

Permalink
chore(clerk-js): Remove unused error helpers (#2978)
Browse files Browse the repository at this point in the history
  • Loading branch information
panteliselef committed Mar 12, 2024
1 parent f4bc0d4 commit ef72c0a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
9 changes: 9 additions & 0 deletions .changeset/polite-avocados-suffer.md
@@ -0,0 +1,9 @@
---
'@clerk/clerk-js': minor
---

Remove unused error helpers.
- clerkErrorInvalidColor()
- clerkCoreErrorUserIsNotDefined()
- clerkCoreErrorSessionIsNotDefined()
- clerkCoreErrorOrganizationIsNotDefined()
16 changes: 0 additions & 16 deletions packages/clerk-js/src/core/errors.ts
Expand Up @@ -18,26 +18,10 @@ export function clerkErrorPathRouterMissingPath(componentName: string): never {
);
}

export function clerkErrorInvalidColor(name: string): never {
throw new Error(`${errorPrefix} You're using an invalid ${name} color. Change the ${name} color from the dashboard.`);
}

export function clerkCoreErrorContextProviderNotFound(providerName: string): never {
throw new Error(`${errorPrefix} You must wrap your application in a <${providerName}> component.`);
}

export function clerkCoreErrorUserIsNotDefined(): never {
throw new Error(`${errorPrefix} User is undefined. Try wrapping your component with \`withUserGuard\``);
}

export function clerkCoreErrorSessionIsNotDefined(): never {
throw new Error(`${errorPrefix} Session is undefined. Try wrapping your component with \`withUserGuard\``);
}

export function clerkCoreErrorOrganizationIsNotDefined(): never {
throw new Error(`${errorPrefix} Organization is undefined. Try wrapping your component with \`withUserGuard\``);
}

export function clerkCoreErrorNoClerkSingleton(): never {
throw new Error(`${errorPrefix} Clerk is undefined`);
}
Expand Down

0 comments on commit ef72c0a

Please sign in to comment.