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

fix: add model-unrelated errors to alerts #2813

Merged

Conversation

adrianthedev
Copy link
Collaborator

@adrianthedev adrianthedev commented May 27, 2024

Description

The create failing action already has a turbo_stream response.
This PR adds it to the update action as well.

We also add any exception error to the response.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have added tests that prove my fix is effective or that my feature works

Copy link

codeclimate bot commented May 27, 2024

Code Climate has analyzed commit 4cb801c and detected 1 issue on this pull request.

Here's the issue category breakdown:

Category Count
Complexity 1

View more on Code Climate.

@adrianthedev adrianthedev merged commit 1c2d91b into main May 28, 2024
20 of 21 checks passed
@adrianthedev adrianthedev deleted the refactor/add-turbo-response-to-failing-update-action branch May 28, 2024 07:41
Copy link
Contributor

This PR has been merged into main. The functionality will be available in the next release.

Please check the release guide for more information.

Comment on lines +234 to +241
@errors = @errors.reject { |error| exception_message.include? error }
end

# Figure out if we have to output the exception_message
# Usually it means that it's not a validation error but something else
if exception_message.present?
exception_is_validation = @errors.select { |error| exception_message.include? error }.present?
end
Copy link
Contributor

@Paul-Bob Paul-Bob Jun 17, 2024

Choose a reason for hiding this comment

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

Since this code

@errors = @errors.reject { |error| exception_message.include? error }

runs before this one

exception_is_validation = @errors.select { |error| exception_message.include? error }.present?

will the second one ever be true?

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

Successfully merging this pull request may close these issues.

2 participants