Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement GenericErrorResponse interface for all errors returned from /v2 #1855

Open
Tracked by #1367
manuelwedler opened this issue Jan 15, 2025 · 0 comments
Open
Tracked by #1367

Comments

@manuelwedler
Copy link
Collaborator

manuelwedler commented Jan 15, 2025

In the API v2 design we created the GenericErrorResponse interface for all errors returned by the new API:

export interface GenericErrorResponse {
  customCode: ErrorCode;
  message: string;
  errorId: string;
}

We should make sure that all errors that are returned from the /v2 endpoints are following this format. For that, we can implement some middleware, e.g. use("/v2", errorHandlingMiddleware) that matches unknown / uncaught errors to the new interface. This should also catch the ones returned by safeHandler. We should also ensure that validation errors follow this format. We might need to adapt our genericErrorHandler from api v1.

We will also need to define the custom error codes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Triage
Development

No branches or pull requests

1 participant