Find @ResponseStatus recursively on getCause()

Issue: SPR-12903
This commit is contained in:
Rossen Stoyanchev
2015-04-13 18:10:55 -04:00
parent c172d9d745
commit 26cfe5795f
3 changed files with 66 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2015 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.
@@ -61,6 +61,10 @@ public class ResponseStatusExceptionResolver extends AbstractHandlerExceptionRes
logger.warn("Handling of @ResponseStatus resulted in Exception", resolveEx);
}
}
else if (ex.getCause() != null && ex.getCause() instanceof Exception) {
ex = (Exception) ex.getCause();
return doResolveException(request, response, handler, ex);
}
return null;
}