This repository has been archived by the owner on Jul 13, 2023. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
CommandNotFoundError is rescued and added to model errors #1352
Comments
Hi @adamniedzielski ! Is this still an issue for you in Paperclip; I know this issue is from approximately 2 years ago. If it is still an issue, can you please provide the code that's causing you the error? Thanks! |
Looking at the code I can tell that nothing has changed here: |
How would you like to see errors resolved - feel free to send in a PR with your approach to solve the problem. |
Closed
After looking at exceptions inheriting from |
Sounds fine to me. Would you be willing to send in a PR? |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I spent some time debugging when I pushed the code to my CI server and one spec was failing. The spec was a Capybara feature which was submitting form with attachment and checking if the model got saved. Finally I found the error among validation errors - it was CommandNotFoundError - "Could not run the
identify
command. Please install ImageMagick."This was quite surprising, because it is a missing dependency and certainly not validation error. I cannot imagine a case when I want to present it to the end-user.
Looking through the code I found the reason of this behaviour:
https://github.com/thoughtbot/paperclip/blob/adddf87cf30d416d71c7b2a80a004d170d10dc2c/lib/paperclip/attachment.rb#L434-437
In this case I would expect that the exception is not rescued at all because it is a matter of overlooked dependency and should be clearly visible. Visible to the dev, not the user.
What do you think?
The text was updated successfully, but these errors were encountered: