jaxrs: fix printing of NPE in RuntimeExceptionMapper
/*
* 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
