diff options
Diffstat (limited to 'vespaclient-container-plugin')
2 files changed, 13 insertions, 13 deletions
diff --git a/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/DocumentOperationExecutorImpl.java b/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/DocumentOperationExecutorImpl.java index fb06991f2df..135b6a824c8 100644 --- a/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/DocumentOperationExecutorImpl.java +++ b/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/DocumentOperationExecutorImpl.java @@ -221,8 +221,8 @@ public class DocumentOperationExecutorImpl implements DocumentOperationExecutor catch (IllegalArgumentException | ParseException e) { context.error(BAD_REQUEST, Exceptions.toMessageString(e)); } - catch (Throwable t) { - context.error(ERROR, Exceptions.toMessageString(t)); + catch (RuntimeException e) { + context.error(ERROR, Exceptions.toMessageString(e)); } } diff --git a/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/DocumentV1ApiHandler.java b/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/DocumentV1ApiHandler.java index ef5cd0a81ce..98bbb029ea8 100644 --- a/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/DocumentV1ApiHandler.java +++ b/vespaclient-container-plugin/src/main/java/com/yahoo/document/restapi/resource/DocumentV1ApiHandler.java @@ -166,8 +166,8 @@ public class DocumentV1ApiHandler extends AbstractRequestHandler { catch (IllegalArgumentException e) { return badRequest(request, e, responseHandler); } - catch (Throwable t) { - return serverError(request, t, responseHandler); + catch (RuntimeException e) { + return serverError(request, e, responseHandler); } } @@ -250,8 +250,8 @@ public class DocumentV1ApiHandler extends AbstractRequestHandler { } } // TODO jonmv: This shouldn't happen much, but ... expose errors too? - catch (Throwable t) { - log.log(WARNING, "Exception serializing document in document/v1 visit response", t); + catch (RuntimeException e) { + log.log(WARNING, "Exception serializing document in document/v1 visit response", e); } }); } @@ -296,8 +296,8 @@ public class DocumentV1ApiHandler extends AbstractRequestHandler { catch (IllegalArgumentException e) { badRequest(request, e, handler); } - catch (Throwable t) { - serverError(request, t, handler); + catch (RuntimeException e) { + serverError(request, e, handler); } }); } @@ -318,8 +318,8 @@ public class DocumentV1ApiHandler extends AbstractRequestHandler { catch (IllegalArgumentException e) { badRequest(request, e, handler); } - catch (Throwable t) { - serverError(request, t, handler); + catch (RuntimeException e) { + serverError(request, e, handler); } }); } @@ -423,10 +423,10 @@ public class DocumentV1ApiHandler extends AbstractRequestHandler { return respond(Response.Status.TOO_MANY_REQUESTS, root, handler); } - private static ContentChannel serverError(HttpRequest request, Throwable t, ResponseHandler handler) { - log.log(WARNING, "Uncaught exception handling request " + request.getMethod() + " " + request.getUri().getRawPath() + ":", t); + private static ContentChannel serverError(HttpRequest request, RuntimeException e, ResponseHandler handler) { + log.log(WARNING, "Uncaught exception handling request " + request.getMethod() + " " + request.getUri().getRawPath() + ":", e); Cursor root = responseRoot(request); - root.setString("message", Exceptions.toMessageString(t)); + root.setString("message", Exceptions.toMessageString(e)); return respond(Response.Status.INTERNAL_SERVER_ERROR, root, handler); } |