(Bug) Wrong Exception - Upload #445

Closed
leocwolter opened this Issue Jul 6, 2012 · 1 comment

Comments

Projects
None yet
2 participants
Contributor

leocwolter commented Jul 6, 2012

The exception below is being thrown when the size of a file exceeds the upload limit:

java.util.MissingResourceException: Can't find bundle for base name messages, locale en_US

It would be better if the exception were more descriptive

Member

lucascs commented Jul 6, 2012

It is a validation error, so we need a resource bundle to get the validation message.
If you create a file named messages.properties on classpath you will see the message using the i18n key file.limit.exceeded
https://github.com/caelum/vraptor/blob/master/vraptor-core/src/main/java/br/com/caelum/vraptor/interceptor/multipart/CommonsUploadMultipartInterceptor.java#L149

Maybe the solution would be changing this validation.checking to:
validator.add(new I18nMessage("upload", "file.limit.exceeded", e.getActualSize(), e.getPermittedSize()));

Do you want to do this change and send us a pull request?

@lucascs lucascs closed this in e471518 Oct 16, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment