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

When file size is larger, validation error is not passed "undefined method `errors' for nil:NilClass" #103

Open
basicavisual opened this issue Oct 9, 2023 · 2 comments

Comments

@basicavisual
Copy link

basicavisual commented Oct 9, 2023

Steps to reproduce:

  1. Upload a file larger than the maximum allowed size
  2. You will find an error as follows
    image

On examining create_document.rb:25 on runtime, document variable returns nil. However, create_document is correctly raising an ActiveRecord::RecordInvalid validation error so my guess is that the way in which the begin / rescue statement is written is not allowing the document variable to be passed to the rescue block.

image

However, I think the pattern is correct and should be passing that variable... here's an example of such pattern on the decidim gem. I can't figure out the reason why the document variable is not passing, but if anyone has a clue I'd be happy to contribute

@microstudi
Copy link
Contributor

Hi @basicavisual we've introduced new validations in the document.
Could you check if this is still happening?

@basicavisual
Copy link
Author

basicavisual commented Oct 27, 2023

Hey there! did a test today and I'm getting the same error but I noticed your commit #98 is this the one you are referring to? because that one's about suggestion lengths, I meant the issue to pertain PDF file size, so, more related to #101

Specifically by this line seems like the document variable is nil. Are you able to reproduce?

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

No branches or pull requests

2 participants