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

Ensure debug server error handler displays error details in case of invalid record exceptions #123

Open
ellmetha opened this issue Aug 18, 2023 · 0 comments

Comments

@ellmetha
Copy link
Member

Description

By default, the Marten::Handlers::Defaults::Debug::ServerError handler (which is called when an unhandled exception is raised in development) displays only the message of the showcased exception, which does not help much in case of Marten::DB::Errors::InvalidRecord exceptions (which are raised when trying to save invalid model records).

Let's implement a special case in order to ensure that validation error details are surfaced for these exceptions in this debug page. In this light, we could probably iterate over the error set (instance of Marten::Core::Validation::ErrorSet) for the considered record and display for each error the corresponding field and message.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

1 participant