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 3556160 commit 5537eca
Show file tree
Hide file tree
Showing 43 changed files with 93 additions and 95 deletions.
9 changes: 4 additions & 5 deletions apps/dashboard/lib/trpc/routers/api/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const createApi = rateLimitedProcedure(ratelimit.create)
.catch((_err) => {
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message: "We are unable to create an API. Please contact support using support@unkey.dev",
message: "We are unable to create an API. Please try again or contact support@unkey.dev",
});
});
if (!ws) {
Expand All @@ -44,7 +44,7 @@ export const createApi = rateLimitedProcedure(ratelimit.create)
} catch (_err) {
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message: "We are unable to create an API. Please contact support using support@unkey.dev",
message: "We are unable to create an API. Please try again or contact support@unkey.dev",
});
}

Expand All @@ -67,7 +67,7 @@ export const createApi = rateLimitedProcedure(ratelimit.create)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We are unable to create the API. Please contact support using support@unkey.dev",
"We are unable to create the API. Please try again or contact support@unkey.dev",
});
});

Expand All @@ -94,8 +94,7 @@ export const createApi = rateLimitedProcedure(ratelimit.create)
.catch((_err) => {
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We are unable to create the API. Please contact support using support@unkey.dev",
message: "We are unable to create the API. Please try again or contact support@unkey.dev",
});
});

Expand Down
6 changes: 3 additions & 3 deletions apps/dashboard/lib/trpc/routers/api/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ export const deleteApi = rateLimitedProcedure(ratelimit.delete)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We are unable to delete this API. Please contact support using support@unkey.dev",
"We are unable to delete this API. Please try again or contact support@unkey.dev",
});
});
if (!api || api.workspace.tenantId !== ctx.tenant.id) {
throw new TRPCError({
code: "NOT_FOUND",
message: "The API does not exist. Please contact support using support@unkey.dev",
message: "The API does not exist. Please try again or contact support@unkey.dev",
});
}
if (api.deleteProtection) {
Expand Down Expand Up @@ -107,7 +107,7 @@ export const deleteApi = rateLimitedProcedure(ratelimit.delete)
} catch (_err) {
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message: "We are unable to delete the API. Please contact support using support@unkey.dev",
message: "We are unable to delete the API. Please try again or contact support@unkey.dev",
});
}
});
2 changes: 1 addition & 1 deletion apps/dashboard/lib/trpc/routers/api/setDefaultBytes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const setDefaultApiBytes = rateLimitedProcedure(ratelimit.update)
throw new TRPCError({
code: "NOT_FOUND",
message:
"We are unable to find the correct keyAuth. Please contact support using support@unkey.dev",
"We are unable to find the correct keyAuth. Please try again or contact support@unkey.dev",
});
}
await db
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/lib/trpc/routers/api/setDefaultPrefix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const setDefaultApiPrefix = rateLimitedProcedure(ratelimit.update)
throw new TRPCError({
code: "NOT_FOUND",
message:
"We are unable to find the correct keyAuth. Please contact support using support@unkey.dev",
"We are unable to find the correct keyAuth. Please try again or contact support@unkey.dev",
});
}
await db
Expand Down
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 @@ -25,7 +25,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",
});
});
if (!api || api.workspace.tenantId !== ctx.tenant.id) {
Expand Down Expand Up @@ -80,7 +80,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",
});
});
});
6 changes: 3 additions & 3 deletions apps/dashboard/lib/trpc/routers/api/updateIpWhitelist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export const updateApiIpWhitelist = rateLimitedProcedure(ratelimit.update)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We are unable to update the API whitelist. Please contact support using support@unkey.dev",
"We are unable to update the API whitelist. Please try again or contact support@unkey.dev",
});
});
if (!api || api.workspace.tenantId !== ctx.tenant.id) {
Expand All @@ -65,7 +65,7 @@ export const updateApiIpWhitelist = rateLimitedProcedure(ratelimit.update)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We are unable to update the API whitelist. Please contact support using support@unkey.dev",
"We are unable to update the API whitelist. Please try again or contact support@unkey.dev",
});
});
await insertAuditLogs(tx, {
Expand All @@ -92,7 +92,7 @@ export const updateApiIpWhitelist = rateLimitedProcedure(ratelimit.update)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We are unable to update the API whitelist. Please contact support using support@unkey.dev",
"We are unable to update the API whitelist. Please try again or contact support@unkey.dev",
});
});
});
2 changes: 1 addition & 1 deletion apps/dashboard/lib/trpc/routers/key/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const createKey = rateLimitedProcedure(ratelimit.create)
throw new TRPCError({
code: "NOT_FOUND",
message:
"We are unable to find the correct keyAuth. Please contact support using support@unkey.dev",
"We are unable to find the correct keyAuth. Please try again or contact support@unkey.dev",
});
}

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

Expand Down
3 changes: 1 addition & 2 deletions apps/dashboard/lib/trpc/routers/key/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,7 @@ export const deleteKeys = rateLimitedProcedure(ratelimit.delete)
.catch((_err) => {
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We are unable to delete the key. Please contact support using support@unkey.dev",
message: "We are unable to delete the key. Please try again or contact support@unkey.dev",
});
});
});
2 changes: 1 addition & 1 deletion apps/dashboard/lib/trpc/routers/key/deleteRootKey.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ export const deleteRootKeys = rateLimitedProcedure(ratelimit.delete)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We are unable to delete the root key. Please contact support using support@unkey.dev",
"We are unable to delete the root key. Please try again or contact support@unkey.dev",
});
});
});
6 changes: 3 additions & 3 deletions apps/dashboard/lib/trpc/routers/key/updateEnabled.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const updateKeyEnabled = rateLimitedProcedure(ratelimit.update)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We were unable to update enabled on this key. Please contact support using support@unkey.dev",
"We were unable to update enabled on this key. Please try again or contact support@unkey.dev",
});
});
if (!key || key.workspace.tenantId !== ctx.tenant.id) {
Expand All @@ -47,7 +47,7 @@ export const updateKeyEnabled = rateLimitedProcedure(ratelimit.update)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We were unable to update enabled on this key. Please contact support using support@unkey.dev",
"We were unable to update enabled on this key. Please try again or contact support@unkey.dev",
});
});
await insertAuditLogs(tx, {
Expand All @@ -74,7 +74,7 @@ export const updateKeyEnabled = rateLimitedProcedure(ratelimit.update)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We were unable to update enabled on this key. Please contact support using support@unkey.dev",
"We were unable to update enabled on this key. Please try again or contact support@unkey.dev",
});
});
});
6 changes: 3 additions & 3 deletions apps/dashboard/lib/trpc/routers/key/updateExpiration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export const updateKeyExpiration = rateLimitedProcedure(ratelimit.update)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We were unable to update expiration on this key. Please contact support using support@unkey.dev",
"We were unable to update expiration on this key. Please try again or contact support@unkey.dev",
});
});
if (!key || key.workspace.tenantId !== ctx.tenant.id) {
Expand All @@ -67,7 +67,7 @@ export const updateKeyExpiration = rateLimitedProcedure(ratelimit.update)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We were unable to update expiration on this key. Please contact support using support@unkey.dev",
"We were unable to update expiration on this key. Please try again or contact support@unkey.dev",
});
});
await insertAuditLogs(tx, {
Expand Down Expand Up @@ -98,7 +98,7 @@ export const updateKeyExpiration = rateLimitedProcedure(ratelimit.update)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We were unable to update expiration on this key. Please contact support using support@unkey.dev",
"We were unable to update expiration on this key. Please try again or contact support@unkey.dev",
});
});

Expand Down
6 changes: 3 additions & 3 deletions apps/dashboard/lib/trpc/routers/key/updateMetadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const updateKeyMetadata = rateLimitedProcedure(ratelimit.update)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We were unable to update metadata on this key. Please contact support using support@unkey.dev",
"We were unable to update metadata on this key. Please try again or contact support@unkey.dev",
});
});
if (!key || key.workspace.tenantId !== ctx.tenant.id) {
Expand All @@ -60,7 +60,7 @@ export const updateKeyMetadata = rateLimitedProcedure(ratelimit.update)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We are unable to update metadata on this key. Please contact support using support@unkey.dev",
"We are unable to update metadata on this key. Please try again or contact support@unkey.dev",
});
});
await insertAuditLogs(tx, {
Expand All @@ -87,7 +87,7 @@ export const updateKeyMetadata = rateLimitedProcedure(ratelimit.update)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We are unable to update metadata on this key. Please contact support using support@unkey.dev",
"We are unable to update metadata on this key. Please try again or contact support@unkey.dev",
});
});

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

Expand Down
6 changes: 3 additions & 3 deletions apps/dashboard/lib/trpc/routers/key/updateOwnerId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const updateKeyOwnerId = rateLimitedProcedure(ratelimit.update)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We were unable to update ownerId on this key. Please contact support using support@unkey.dev",
"We were unable to update ownerId on this key. Please try again or contact support@unkey.dev",
});
});
if (!key || key.workspace.tenantId !== ctx.tenant.id) {
Expand All @@ -47,7 +47,7 @@ export const updateKeyOwnerId = rateLimitedProcedure(ratelimit.update)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We were unable to update ownerId on this key. Please contact support using support@unkey.dev",
"We were unable to update ownerId on this key. Please try again or contact support@unkey.dev",
});
});
await insertAuditLogs(tx, {
Expand All @@ -74,7 +74,7 @@ export const updateKeyOwnerId = rateLimitedProcedure(ratelimit.update)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We were unable to update ownerId on this key. Please contact support using support@unkey.dev",
"We were unable to update ownerId on this key. Please try again or contact support@unkey.dev",
});
});

Expand Down
4 changes: 2 additions & 2 deletions apps/dashboard/lib/trpc/routers/key/updateRatelimit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const updateKeyRatelimit = rateLimitedProcedure(ratelimit.update)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We were unable to update ratelimits on this key. Please contact support using support@unkey.dev",
"We were unable to update ratelimits on this key. Please try again or contact support@unkey.dev",
});
});
if (!key || key.workspace.tenantId !== ctx.tenant.id) {
Expand Down Expand Up @@ -122,7 +122,7 @@ export const updateKeyRatelimit = rateLimitedProcedure(ratelimit.update)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We were unable to update ratelimit on this key. Please contact support using support@unkey.dev",
"We were unable to update ratelimit on this key. Please try again or contact support@unkey.dev",
});
});
}
Expand Down
4 changes: 2 additions & 2 deletions apps/dashboard/lib/trpc/routers/key/updateRemaining.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export const updateKeyRemaining = rateLimitedProcedure(ratelimit.update)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We were unable to update remaining on this key. Please contact support using support@unkey.dev",
"We were unable to update remaining on this key. Please try again or contact support@unkey.dev",
});
});
await insertAuditLogs(tx, {
Expand Down Expand Up @@ -92,7 +92,7 @@ export const updateKeyRemaining = rateLimitedProcedure(ratelimit.update)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We were unable to update remaining limits on this key. Please contact support using support@unkey.dev",
"We were unable to update remaining limits on this key. Please try again or contact support@unkey.dev",
});
});
});
6 changes: 3 additions & 3 deletions apps/dashboard/lib/trpc/routers/key/updateRootKeyName.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const updateRootKeyName = t.procedure
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We were unable to update root key name. Please contact support using support@unkey.dev",
"We were unable to update root key name. Please try again or contact support@unkey.dev",
});
});

Expand Down Expand Up @@ -59,7 +59,7 @@ export const updateRootKeyName = t.procedure
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We are unable to update root key name. Please contact support using support@unkey.dev",
"We are unable to update root key name. Please try again or contact support@unkey.dev",
});
});
await insertAuditLogs(tx, {
Expand All @@ -86,7 +86,7 @@ export const updateRootKeyName = t.procedure
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We are unable to update root key name. Please contact support using support@unkey.dev",
"We are unable to update root key name. Please try again or contact support@unkey.dev",
});
});
});
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 @@ -22,7 +22,7 @@ export const createLlmGateway = rateLimitedProcedure(ratelimit.create)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We were unable to create LLM gateway. Please contact support using support@unkey.dev",
"We were unable to create LLM gateway. Please try again or contact support@unkey.dev",
});
});
if (!ws) {
Expand Down
6 changes: 3 additions & 3 deletions apps/dashboard/lib/trpc/routers/llmGateway/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const deleteLlmGateway = rateLimitedProcedure(ratelimit.delete)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We are unable to delete LLM gateway. Please contact support using support@unkey.dev",
"We are unable to delete LLM gateway. Please try again or contact support@unkey.dev",
});
});

Expand All @@ -44,7 +44,7 @@ export const deleteLlmGateway = rateLimitedProcedure(ratelimit.delete)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We are unable to delete the LLM gateway. Please contact support using support@unkey.dev",
"We are unable to delete the LLM gateway. Please try again or contact support@unkey.dev",
});
});
await insertAuditLogs(tx, {
Expand All @@ -71,7 +71,7 @@ export const deleteLlmGateway = rateLimitedProcedure(ratelimit.delete)
throw new TRPCError({
code: "INTERNAL_SERVER_ERROR",
message:
"We are unable to delete LLM gateway. Please contact support using support@unkey.dev",
"We are unable to delete LLM gateway. Please try again or contact support@unkey.dev",
});
});

Expand Down
Loading

0 comments on commit 5537eca

Please sign in to comment.