From 58ffca76c3da0c8af39bbbb569b00ee0bde2546e Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Tue, 30 Aug 2016 12:57:46 +0200 Subject: [PATCH] CommonsMultipartResolver explicitly converts FileSizeLimitExceededException Issue: SPR-14638 --- .../web/multipart/commons/CommonsMultipartResolver.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsMultipartResolver.java b/spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsMultipartResolver.java index b40c42f9475..647b5dd09ad 100644 --- a/spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsMultipartResolver.java +++ b/spring-web/src/main/java/org/springframework/web/multipart/commons/CommonsMultipartResolver.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2015 the original author or authors. + * Copyright 2002-2016 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -160,8 +160,11 @@ public class CommonsMultipartResolver extends CommonsFileUploadSupport catch (FileUploadBase.SizeLimitExceededException ex) { throw new MaxUploadSizeExceededException(fileUpload.getSizeMax(), ex); } + catch (FileUploadBase.FileSizeLimitExceededException ex) { + throw new MaxUploadSizeExceededException(fileUpload.getFileSizeMax(), ex); + } catch (FileUploadException ex) { - throw new MultipartException("Could not parse multipart servlet request", ex); + throw new MultipartException("Failed to parse multipart servlet request", ex); } }