Skip to content

Commit 58ffca7

Browse files
committed
CommonsMultipartResolver explicitly converts FileSizeLimitExceededException
Issue: SPR-14638
1 parent 960d335 commit 58ffca7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsMultipartResolver.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2015 the original author or authors.
2+
* Copyright 2002-2016 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -160,8 +160,11 @@ protected MultipartParsingResult parseRequest(HttpServletRequest request) throws
160160
catch (FileUploadBase.SizeLimitExceededException ex) {
161161
throw new MaxUploadSizeExceededException(fileUpload.getSizeMax(), ex);
162162
}
163+
catch (FileUploadBase.FileSizeLimitExceededException ex) {
164+
throw new MaxUploadSizeExceededException(fileUpload.getFileSizeMax(), ex);
165+
}
163166
catch (FileUploadException ex) {
164-
throw new MultipartException("Could not parse multipart servlet request", ex);
167+
throw new MultipartException("Failed to parse multipart servlet request", ex);
165168
}
166169
}
167170

0 commit comments

Comments
 (0)