Skip to content

Improve Error Handling Architecture#1506

Merged
Ezequiel-Valencia merged 23 commits intomasterfrom
error-handling-architecture
May 22, 2025
Merged

Improve Error Handling Architecture#1506
Ezequiel-Valencia merged 23 commits intomasterfrom
error-handling-architecture

Conversation

@Ezequiel-Valencia
Copy link
Copy Markdown
Contributor

@Ezequiel-Valencia Ezequiel-Valencia commented May 16, 2025

Introduce a flow which allows for errors to be logged, have their appropriate HTTP codes, and be included within the generated OpenAPI spec.

  • Introduce VCellHTTPError response object for errors
  • Ensure each endpoint throws the appropriate error that is expected
  • Utilize a factory method within the client to de-marshal the errors thrown by the server, while keeping the original function signatures
  • Unit tests for error handling.

@Ezequiel-Valencia
Copy link
Copy Markdown
Contributor Author

Ezequiel-Valencia commented May 21, 2025

In total this PR provides the following changes:

  • Update Quarkus server error handling architecture such that:
    • All errors thrown from handlers are web based errors, that is they inherit the base error ApiException
    • Exception mappers are used to catch all exceptions and return to the client an appropriate response
    • Logging all errors on the server that are thrown back to the client
  • Utilize an error factory in the GUI client that assigns web errors to domain specific errors
  • Remove git patches that fixed client file receiving, now implementing fixes within the custom object mapper

@Ezequiel-Valencia
Copy link
Copy Markdown
Contributor Author

Ezequiel-Valencia commented May 21, 2025

  • Relocate the custom object mapper
  • Ensure all original server errors are preserved when sending errors to the client, such that they can see the same message and catch the same exception
  • Remove the hard coded BioModel error used for testing.

Copy link
Copy Markdown
Member

@jcschaff jcschaff left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was great work. we now have a good pattern for migrating the endpoints from RPC to REST while preserving error handling. Approved.

@Ezequiel-Valencia Ezequiel-Valencia merged commit 31a8124 into master May 22, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve API Error Handling Architecture with Centralized Aggirgator

2 participants