From 83636d2c09802aeeb1b30078022d228d04da21eb Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 15 Aug 2014 16:17:25 +0200 Subject: java: when rethrowing exceptions, store the original cause so that we get a nice complete stacktrace when it hits the final handler Change-Id: Iec4fcc15a2a25c55f591b5e069dce3d010197a90 --- xmlsecurity/test_docs/tools/httpserv/src/httpserv/Main.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'xmlsecurity') diff --git a/xmlsecurity/test_docs/tools/httpserv/src/httpserv/Main.java b/xmlsecurity/test_docs/tools/httpserv/src/httpserv/Main.java index 6629a327a0ca..d9c2c07b292f 100644 --- a/xmlsecurity/test_docs/tools/httpserv/src/httpserv/Main.java +++ b/xmlsecurity/test_docs/tools/httpserv/src/httpserv/Main.java @@ -130,10 +130,10 @@ class MyHandler implements HttpHandler { System.out.println("requested: " + sRequestPath); File fileRequest = new File(new File(".").getCanonicalPath(), sRequestPath); if (!fileRequest.exists()) { - throw new Exception("The file " + fileRequest.toString() + " does not exist!\n"); + throw new IOException("The file " + fileRequest + " does not exist!"); } else if (fileRequest.isDirectory()) { - throw new Exception(fileRequest.toString() + " is a directory!\n"); + throw new IOException(fileRequest + " is a directory!\n"); } -- cgit