killbill-uncached

jaxrs: fix printing of NPE in RuntimeExceptionMapper Signed-off-by:

11/21/2018 3:48:51 AM

Details

diff --git a/jaxrs/src/main/java/org/killbill/billing/jaxrs/mappers/RuntimeExceptionMapper.java b/jaxrs/src/main/java/org/killbill/billing/jaxrs/mappers/RuntimeExceptionMapper.java
index 5117e1f..f8cbbaa 100644
--- a/jaxrs/src/main/java/org/killbill/billing/jaxrs/mappers/RuntimeExceptionMapper.java
+++ b/jaxrs/src/main/java/org/killbill/billing/jaxrs/mappers/RuntimeExceptionMapper.java
@@ -1,7 +1,9 @@
 /*
  * Copyright 2010-2013 Ning, Inc.
+ * Copyright 2014-2018 Groupon, Inc
+ * Copyright 2014-2018 The Billing Project, LLC
  *
- * Ning licenses this file to you under the Apache License, version 2.0
+ * The Billing Project licenses this file to you under the Apache License, version 2.0
  * (the "License"); you may not use this file except in compliance with the
  * License.  You may obtain a copy of the License at:
  *
@@ -42,9 +44,7 @@ public class RuntimeExceptionMapper extends ExceptionMapperBase implements Excep
     @Override
     public Response toResponse(final RuntimeException exception) {
         if (exception instanceof NullPointerException) {
-            // Assume bad payload
-            exception.printStackTrace();
-            log.warn("Exception : " + exception.getMessage());
+            log.warn("Unexpected NullPointerException", exception);
             return buildBadRequestResponse(exception, uriInfo);
         } else if (exception instanceof WebApplicationException) {
             // e.g. com.sun.jersey.api.NotFoundException