From 368b36951a52db246ed19bed003069da65ace0a7 Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Thu, 8 Jan 2015 10:54:38 +0100 Subject: [PATCH] DATAREST-434 - Forward root exception in PersistentEntityResourceHandlerMethodArgumentResolver. --- ...stentEntityResourceHandlerMethodArgumentResolver.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/PersistentEntityResourceHandlerMethodArgumentResolver.java b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/PersistentEntityResourceHandlerMethodArgumentResolver.java index ab4087390..5247a8b79 100644 --- a/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/PersistentEntityResourceHandlerMethodArgumentResolver.java +++ b/spring-data-rest-webmvc/src/main/java/org/springframework/data/rest/webmvc/config/PersistentEntityResourceHandlerMethodArgumentResolver.java @@ -173,8 +173,8 @@ public class PersistentEntityResourceHandlerMethodArgumentResolver implements Ha try { JsonPatchHandler handler = new JsonPatchHandler(mapper, reader); return handler.apply(request, existingObject); - } catch (Exception e) { - throw new HttpMessageNotReadableException(String.format(ERROR_MESSAGE, existingObject.getClass())); + } catch (Exception o_O) { + throw new HttpMessageNotReadableException(String.format(ERROR_MESSAGE, existingObject.getClass()), o_O); } } @@ -183,9 +183,8 @@ public class PersistentEntityResourceHandlerMethodArgumentResolver implements Ha try { return converter.read(information.getDomainType(), request.getServerHttpRequest()); - } catch (IOException e) { - throw new HttpMessageNotReadableException(String.format(ERROR_MESSAGE, information.getDomainType())); + } catch (IOException o_O) { + throw new HttpMessageNotReadableException(String.format(ERROR_MESSAGE, information.getDomainType()), o_O); } } - }