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

Add exception message to avoid exposing class #115

Merged
merged 1 commit into from
Jul 20, 2023

Conversation

j15e
Copy link

@j15e j15e commented May 19, 2023

This exception class is added to the model errors and shown to the end-user as is (Errors::NotIdentifiedByImageMagickError), because there is no message attached to it.

The exception is added as a processing error here:

rescue Paperclip::Errors::NotIdentifiedByImageMagickError => e
log("An error was received while processing: #{e.inspect}")
(@errors[:processing] ||= []) << e.message if @options[:whiny]
ensure

And the the processing errors are transferred to the model here:

def flush_errors #:nodoc:
@errors.each do |_error, message|
[message].flatten.each { |m| instance.errors.add(name, m) }
end
end

@j15e j15e force-pushed the bugfix/geometry-exception-message branch from 9f89fd7 to 50f80e6 Compare June 20, 2023 14:19
@ssinghi ssinghi merged commit 88a2ce1 into kreeti:master Jul 20, 2023
1 check 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.

None yet

2 participants