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

Allow for custom CarrierWave error messages #450

Merged
merged 3 commits into from Sep 22, 2011

Conversation

bartt
Copy link

@bartt bartt commented Sep 6, 2011

Hi Jonas,

this patch allows one to rais CarrierWave errors with custom messages. Prior to this patch all processing errors would read: 'failed to be processed' even when one raises a CarrierWave processing error with a custom message.

Similarly CarrierWave's own integrity error message is replaced with the rather short "is not an allowed file type" w/o explaining what extensions are accepted.

I hope you'll accept this patch.

@jnicklas
Copy link
Member

jnicklas commented Sep 6, 2011

Could you add some tests for this behaviour, not sure I quite understand what this is doing?

- Add test for all but mime_types
@bartt
Copy link
Author

bartt commented Sep 7, 2011

Jonas, I've added test cases and I18n all error messages. Give it try. See if you can force a ::MIME::InvalidContentType error, that is the only one missing.

@trevorturk
Copy link
Contributor

@bartt I'm seeing "This pull request cannot be automatically merged." so you may need to rebase your commits in order for us to merge. I'd check with @jnicklas before doing more work, though -- I'm not clear on whether or not he's interested in merging.

Conflicts:
	spec/orm/activerecord_spec.rb
@bartt
Copy link
Author

bartt commented Sep 18, 2011

@trevorturk, conflict resolved. I do hope @jnicklas will merge the changes as the current code doesn't allow for custom error messages. These changes allow for custom error messages while preserving i18n.

trevorturk added a commit that referenced this pull request Sep 22, 2011
Allow for custom CarrierWave error messages
@trevorturk trevorturk merged commit 84b3918 into carrierwaveuploader:master Sep 22, 2011
@trevorturk
Copy link
Contributor

Merged -- thanks @bartt!

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

3 participants