import java.io.BufferedOutputStream;
+import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.net.HttpURLConnection;
// or error line will be logged twice
throw new BuildException(error);
}
- } catch (Throwable t) {
+ } catch (Exception e) {
if (isFailOnError()) {
- throw new BuildException(t);
+ throw new BuildException(e);
} else {
- handleErrorOutput(t.getMessage());
+ handleErrorOutput(e.getMessage());
}
} finally {
closeRedirector();
if (reader != null) {
try {
reader.close();
- } catch (Throwable u) {
- ExceptionUtils.handleThrowable(u);
+ } catch (IOException ioe) {
+ // Ignore
}
reader = null;
}
if (istream != null) {
try {
istream.close();
- } catch (Throwable u) {
- ExceptionUtils.handleThrowable(u);
+ } catch (IOException ioe) {
+ // Ignore
}
istream = null;
}
is.setByteStream(stream);
digester.parse(is);
handleOutput("web.xml validated");
- } catch (Throwable t) {
+ } catch (Exception e) {
if (isFailOnError()) {
- throw new BuildException("Validation failure", t);
+ throw new BuildException("Validation failure", e);
} else {
- handleErrorOutput("Validation failure: " + t);
+ handleErrorOutput("Validation failure: " + e);
}
} finally {
Thread.currentThread().setContextClassLoader(oldCL);
try {
value = jmxServerConnection
.getAttribute(oname, attName);
- } catch (Throwable t) {
+ } catch (Exception e) {
if (isEcho())
handleErrorOutput("Error getting attribute "
+ oname + " " + pname + attName + " "
- + t.toString());
+ + e.toString());
continue;
}
if (value == null)
// or error line will be logged twice
throw new BuildException(error);
}
- } catch (Throwable t) {
+ } catch (Exception e) {
if (isFailOnError()) {
- throw new BuildException(t);
+ throw new BuildException(e);
} else {
- handleErrorOutput(t.getMessage());
+ handleErrorOutput(e.getMessage());
}
} finally {
closeRedirector();