Skip to content

Commit

Permalink
fix: error message
Browse files Browse the repository at this point in the history
  • Loading branch information
chronark committed Oct 10, 2024
1 parent a1dd4d9 commit 3556160
Show file tree
Hide file tree
Showing 39 changed files with 73 additions and 74 deletions.
6 changes: 3 additions & 3 deletions apps/dashboard/lib/trpc/routers/api/setDefaultBytes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const setDefaultApiBytes = rateLimitedProcedure(ratelimit.update)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We were unable to find the KeyAuth. Please contact support using support@unkey.dev.",
"We were unable to find the KeyAuth. Please try again or contact support@unkey.dev.",
});
});
if (!keyAuth || keyAuth.workspaceId !== input.workspaceId) {
Expand All @@ -48,7 +48,7 @@ export const setDefaultApiBytes = rateLimitedProcedure(ratelimit.update)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We were unable to update the API default bytes. Please contact support using support@unkey.dev.",
"We were unable to update the API default bytes. Please try again or contact support@unkey.dev.",
});
});
await insertAuditLogs(tx, {
Expand All @@ -75,7 +75,7 @@ export const setDefaultApiBytes = rateLimitedProcedure(ratelimit.update)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We were unable to update the default bytes. Please contact support using support@unkey.dev.",
"We were unable to update the default bytes. Please try again or contact support@unkey.dev.",
});
});
});
7 changes: 3 additions & 4 deletions apps/dashboard/lib/trpc/routers/api/setDefaultPrefix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@ export const setDefaultApiPrefix = rateLimitedProcedure(ratelimit.update)
.catch((_err) => {
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We were unable to find KeyAuth. Please contact support using support@unkey.dev.",
message: "We were unable to find KeyAuth. Please try again or contact support@unkey.dev.",
});
});
if (!keyAuth || keyAuth.workspaceId !== input.workspaceId) {
Expand All @@ -44,7 +43,7 @@ export const setDefaultApiPrefix = rateLimitedProcedure(ratelimit.update)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We were unable to update the API default prefix. Please contact support using support@unkey.dev.",
"We were unable to update the API default prefix. Please try again or contact support@unkey.dev.",
});
});
await insertAuditLogs(tx, {
Expand All @@ -71,7 +70,7 @@ export const setDefaultApiPrefix = rateLimitedProcedure(ratelimit.update)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We were unable to update the default prefix. Please contact support using support@unkey.dev.",
"We were unable to update the default prefix. Please try again or contact support@unkey.dev.",
});
});
});
4 changes: 2 additions & 2 deletions apps/dashboard/lib/trpc/routers/api/updateDeleteProtection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const updateAPIDeleteProtection = rateLimitedProcedure(ratelimit.update)
throw new TRPCError({
code: "NOT_FOUND",
message:
"We are unable to find the correct API. Please contact support using support@unkey.dev.",
"We are unable to find the correct API. Please try again or contact support@unkey.dev.",
});
}

Expand All @@ -48,7 +48,7 @@ export const updateAPIDeleteProtection = rateLimitedProcedure(ratelimit.update)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We were unable to update the API. Please contact support using support@unkey.dev.",
"We were unable to update the API. Please try again or contact support@unkey.dev.",
});
});
await insertAuditLogs(tx, {
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/lib/trpc/routers/api/updateIpWhitelist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export const updateApiIpWhitelist = rateLimitedProcedure(ratelimit.update)
throw new TRPCError({
code: "NOT_FOUND",
message:
"We are unable to find the correct API. Please contact support using support@unkey.dev.",
"We are unable to find the correct API. Please try again or contact support@unkey.dev.",
});
}

Expand Down
8 changes: 4 additions & 4 deletions apps/dashboard/lib/trpc/routers/api/updateName.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ export const updateApiName = rateLimitedProcedure(ratelimit.update)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We were unable to update the API name. Please contact support using support@unkey.dev.",
"We were unable to update the API name. Please try again or contact support@unkey.dev.",
});
});
if (!api || api.workspace.tenantId !== ctx.tenant.id) {
throw new TRPCError({
code: "NOT_FOUND",
message:
"We are unable to find the correct API. Please contact support using support@unkey.dev.",
"We are unable to find the correct API. Please try again or contact support@unkey.dev.",
});
}
await db
Expand All @@ -48,7 +48,7 @@ export const updateApiName = rateLimitedProcedure(ratelimit.update)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We were unable to update the API name. Please contact support using support@unkey.dev.",
"We were unable to update the API name. Please try again or contact support@unkey.dev.",
});
});
await insertAuditLogs(tx, {
Expand All @@ -75,7 +75,7 @@ export const updateApiName = rateLimitedProcedure(ratelimit.update)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We were unable to update the API name. Please contact support using support@unkey.dev.",
"We were unable to update the API name. Please try again or contact support@unkey.dev.",
});
});
});
6 changes: 3 additions & 3 deletions apps/dashboard/lib/trpc/routers/key/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,14 +44,14 @@ export const createKey = rateLimitedProcedure(ratelimit.create)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We were unable to create a key for this API. Please contact support using support@unkey.dev.",
"We were unable to create a key for this API. Please try again or contact support@unkey.dev.",
});
});
if (!workspace) {
throw new TRPCError({
code: "NOT_FOUND",
message:
"We are unable to find the correct workspace. Please contact support using support@unkey.dev.",
"We are unable to find the correct workspace. Please try again or contact support@unkey.dev.",
});
}

Expand All @@ -66,7 +66,7 @@ export const createKey = rateLimitedProcedure(ratelimit.create)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We were unable to create a key for this API. Please contact support using support@unkey.dev.",
"We were unable to create a key for this API. Please try again or contact support@unkey.dev.",
});
});
if (!keyAuth || keyAuth.workspaceId !== workspace.id) {
Expand Down
6 changes: 3 additions & 3 deletions apps/dashboard/lib/trpc/routers/key/createRootKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ export const createRootKey = rateLimitedProcedure(ratelimit.create)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We were unable to create a root key for this workspace. Please contact support using support@unkey.dev.",
"We were unable to create a root key for this workspace. Please try again or contact support@unkey.dev.",
});
});
if (!workspace) {
throw new TRPCError({
code: "NOT_FOUND",
message:
"We are unable to find the correct workspace. Please contact support using support@unkey.dev.",
"We are unable to find the correct workspace. Please try again or contact support@unkey.dev.",
});
}

Expand All @@ -52,7 +52,7 @@ export const createRootKey = rateLimitedProcedure(ratelimit.create)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We were unable to create a rootkey for this workspace. Please contact support using support@unkey.dev.",
"We were unable to create a rootkey for this workspace. Please try again or contact support@unkey.dev.",
});
});
if (!unkeyApi) {
Expand Down
4 changes: 2 additions & 2 deletions apps/dashboard/lib/trpc/routers/key/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ export const deleteKeys = rateLimitedProcedure(ratelimit.delete)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We were unable to delete this key. Please contact support using support@unkey.dev.",
"We were unable to delete this key. Please try again or contact support@unkey.dev.",
});
});
if (!workspace) {
throw new TRPCError({
code: "NOT_FOUND",
message:
"We are unable to find the correct workspace. Please contact support using support@unkey.dev.",
"We are unable to find the correct workspace. Please try again or contact support@unkey.dev.",
});
}

Expand Down
4 changes: 2 additions & 2 deletions apps/dashboard/lib/trpc/routers/key/deleteRootKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ export const deleteRootKeys = rateLimitedProcedure(ratelimit.delete)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We were unable to delete this root key. Please contact support using support@unkey.dev.",
"We were unable to delete this root key. Please try again or contact support@unkey.dev.",
});
});

if (!workspace) {
throw new TRPCError({
code: "NOT_FOUND",
message:
"We are unable to find the correct workspace. Please contact support using support@unkey.dev.",
"We are unable to find the correct workspace. Please try again or contact support@unkey.dev.",
});
}

Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/lib/trpc/routers/key/updateEnabled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const updateKeyEnabled = rateLimitedProcedure(ratelimit.update)
throw new TRPCError({
code: "NOT_FOUND",
message:
"We are unable to find the the correct key. Please contact support using support@unkey.dev.",
"We are unable to find the the correct key. Please try again or contact support@unkey.dev.",
});
}

Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/lib/trpc/routers/key/updateExpiration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const updateKeyExpiration = rateLimitedProcedure(ratelimit.update)
if (!key || key.workspace.tenantId !== ctx.tenant.id) {
throw new TRPCError({
message:
"We are unable to find the the correct key. Please contact support using support@unkey.dev.",
"We are unable to find the the correct key. Please try again or contact support@unkey.dev.",
code: "NOT_FOUND",
});
}
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/lib/trpc/routers/key/updateMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const updateKeyMetadata = rateLimitedProcedure(ratelimit.update)
if (!key || key.workspace.tenantId !== ctx.tenant.id) {
throw new TRPCError({
message:
"We are unable to find the correct key. Please contact support using support@unkey.dev.",
"We are unable to find the correct key. Please try again or contact support@unkey.dev.",
code: "NOT_FOUND",
});
}
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/lib/trpc/routers/key/updateName.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const updateKeyName = rateLimitedProcedure(ratelimit.update)
if (!key || key.workspace.tenantId !== ctx.tenant.id) {
throw new TRPCError({
message:
"We are unable to find the correct key. Please contact support using support@unkey.dev.",
"We are unable to find the correct key. Please try again or contact support@unkey.dev.",
code: "NOT_FOUND",
});
}
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/lib/trpc/routers/key/updateOwnerId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const updateKeyOwnerId = rateLimitedProcedure(ratelimit.update)
if (!key || key.workspace.tenantId !== ctx.tenant.id) {
throw new TRPCError({
message:
"We are unable to find the correct key. Please contact support using support@unkey.dev.",
"We are unable to find the correct key. Please try again or contact support@unkey.dev.",
code: "NOT_FOUND",
});
}
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/lib/trpc/routers/key/updateRatelimit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const updateKeyRatelimit = rateLimitedProcedure(ratelimit.update)
if (!key || key.workspace.tenantId !== ctx.tenant.id) {
throw new TRPCError({
message:
"We are unable to find the correct key. Please contact support using support@unkey.dev.",
"We are unable to find the correct key. Please try again or contact support@unkey.dev.",
code: "NOT_FOUND",
});
}
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/lib/trpc/routers/key/updateRemaining.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const updateKeyRemaining = rateLimitedProcedure(ratelimit.update)
if (!key || key.workspace.tenantId !== ctx.tenant.id) {
throw new TRPCError({
message:
"We are unable to find the correct key. Please contact support using support@unkey.dev.",
"We are unable to find the correct key. Please try again or contact support@unkey.dev.",
code: "NOT_FOUND",
});
}
Expand Down
4 changes: 2 additions & 2 deletions apps/dashboard/lib/trpc/routers/key/updateRootKeyName.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,14 +35,14 @@ export const updateRootKeyName = t.procedure
throw new TRPCError({
code: "NOT_FOUND",
message:
"We are unable to find the correct workspace. Please contact support using support@unkey.dev.",
"We are unable to find the correct workspace. Please try again or contact support@unkey.dev.",
});
}

if (!key || key.forWorkspaceId !== workspace.id) {
throw new TRPCError({
message:
"We are unable to find the correct key. Please contact support using support@unkey.dev.",
"We are unable to find the correct key. Please try again or contact support@unkey.dev.",
code: "NOT_FOUND",
});
}
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/lib/trpc/routers/llmGateway/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export const createLlmGateway = rateLimitedProcedure(ratelimit.create)
throw new TRPCError({
code: "NOT_FOUND",
message:
"We are unable to find the correct workspace. Please contact support using support@unkey.dev.",
"We are unable to find the correct workspace. Please try again or contact support@unkey.dev.",
});
}

Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/lib/trpc/routers/llmGateway/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export const deleteLlmGateway = rateLimitedProcedure(ratelimit.delete)
if (!llmGateway || llmGateway.workspace.tenantId !== ctx.tenant.id) {
throw new TRPCError({
code: "NOT_FOUND",
message: "LLM gateway not found. please contact support using support@unkey.dev.",
message: "LLM gateway not found. Please try again or contact support@unkey.dev.",
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export const createNamespace = rateLimitedProcedure(ratelimit.create)
throw new TRPCError({
code: "NOT_FOUND",
message:
"We are unable to find the correct workspace. Please contact support using support@unkey.dev.",
"We are unable to find the correct workspace. Please try again or contact support@unkey.dev.",
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const createOverride = rateLimitedProcedure(ratelimit.create)
throw new TRPCError({
code: "NOT_FOUND",
message:
"We are unable to find the correct namespace. Please contact support using support@unkey.dev.",
"We are unable to find the correct namespace. Please try again or contact support@unkey.dev.",
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export const deleteNamespace = rateLimitedProcedure(ratelimit.delete)
throw new TRPCError({
code: "NOT_FOUND",
message:
"We are unable to find the correct namespace. Please contact support using support@unkey.dev.",
"We are unable to find the correct namespace. Please try again or contact support@unkey.dev.",
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const deleteOverride = rateLimitedProcedure(ratelimit.create)
if (!override || override.namespace.workspace.tenantId !== ctx.tenant.id) {
throw new TRPCError({
message:
"We are unable to find the correct override. Please contact support using support@unkey.dev.",
"We are unable to find the correct override. Please try again or contact support@unkey.dev.",
code: "NOT_FOUND",
});
}
Expand Down
4 changes: 2 additions & 2 deletions apps/dashboard/lib/trpc/routers/ratelimit/updateOverride.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const updateOverride = rateLimitedProcedure(ratelimit.update)
if (!override || override.namespace.workspace.tenantId !== ctx.tenant.id) {
throw new TRPCError({
message:
"We are unable to find the correct override. Please contact support using support@unkey.dev.",
"We are unable to find the correct override. Please try again or contact support@unkey.dev.",
code: "NOT_FOUND",
});
}
Expand All @@ -64,7 +64,7 @@ export const updateOverride = rateLimitedProcedure(ratelimit.update)
.catch((_err) => {
throw new TRPCError({
message:
"We are unable to update the override for this namespace. Please contact support using support@unkey.dev.",
"We are unable to update the override for this namespace. Please try again or contact support@unkey.dev.",
code: "INTERNAL_SERVER_ERROR",
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const addPermissionToRootKey = rateLimitedProcedure(ratelimit.create)
throw new TRPCError({
code: "NOT_FOUND",
message:
"We are unable to find the correct workspace. Please contact support using support@unkey.dev.",
"We are unable to find the correct workspace. Please try again or contact support@unkey.dev.",
});
}

Expand All @@ -57,7 +57,7 @@ export const addPermissionToRootKey = rateLimitedProcedure(ratelimit.create)
throw new TRPCError({
code: "NOT_FOUND",
message:
"We are unable to find the correct root key. Please contact support using support@unkey.dev.",
"We are unable to find the correct root key. Please try again or contact support@unkey.dev.",
});
}

Expand All @@ -79,7 +79,7 @@ export const addPermissionToRootKey = rateLimitedProcedure(ratelimit.create)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We are unable to add permission to the root key. Please contact support using support@unkey.dev.",
"We are unable to add permission to the root key. Please try again or contact support@unkey.dev.",
});
});
await insertAuditLogs(tx, [
Expand Down
Loading

0 comments on commit 3556160

Please sign in to comment.