private void generateHandlerChainFile(Element hChains, Writer writer) throws ToolException { try { StaxUtils.writeTo(hChains, writer, 2); writer.close(); } catch (Exception ex) { throw new ToolException(ex); } } }
public void execute(boolean exitOnFinish) throws ToolException { try { if (getArgument() != null) { super.execute(exitOnFinish); } execute(); } catch (ToolException ex) { if (ex.getCause() instanceof BadUsageException) { printUsageException(TOOL_NAME, (BadUsageException)ex.getCause()); } throw ex; } catch (Exception ex) { throw new ToolException(ex); } finally { tearDown(); } }
private void printThrowable(Throwable t, PrintStream ps, String pfx, String cap) { if (t instanceof ToolException) { ((ToolException)t).printStackTrace(ps, pfx, cap); } else { ps.println(pfx + cap + t); StackTraceElement[] trace = t.getStackTrace(); for (StackTraceElement ste : trace) { ps.println(pfx + "\tat " + ste); } if (t.getCause() != null) { printThrowable(t.getCause(), ps, pfx + "\t", "Caused by: "); } } }
public void printStackTrace(PrintStream ps, String pfx, String cap) { ps.println(pfx + cap + this); StackTraceElement[] trace = super.getStackTrace(); for (StackTraceElement traceElement : trace) { ps.println(pfx + "\tat " + traceElement); } // Print suppressed exceptions, if any for (Throwable se : suppressed) { printThrowable(se, ps, pfx + "\t", "Suppressed: "); } // Print cause, if any Throwable ourCause = getCause(); if (ourCause != null && (!hasSuppressed || ourCause != suppressed.get(0))) { printThrowable(ourCause, ps, pfx + "\t", "Caused by: "); } } private void printThrowable(Throwable t, PrintStream ps, String pfx, String cap) {
err.println("WSDLValidator Error : " + ex.getMessage()); if (ex.getCause() instanceof BadUsageException) { printUsageException(TOOL_NAME, (BadUsageException)ex.getCause()); err.println("[+] Verbose turned on"); err.println(); ex.printStackTrace(err);
err.println("Error : " + ex.getMessage()); if (ex.getCause() instanceof BadUsageException) { printUsageException(TOOL_NAME, (BadUsageException)ex.getCause()); ex.printStackTrace(err); ex.printStackTrace(err); throw new ToolException(ex.getMessage(), ex.getCause());
if (ex.getCause() instanceof BadUsageException) { printUsageException(TOOL_NAME, (BadUsageException)ex.getCause()); if (isVerboseOn()) { ex.printStackTrace(err); throw new ToolException(ex.getMessage(), ex.getCause()); } finally { tearDown();
public static void main(String[] pargs) { System.setProperty("org.apache.cxf.JDKBugHacks.defaultUsesCaches", "true"); CommandInterfaceUtils.commandCommonMain(); WADLToJava w2j = new WADLToJava(pargs); try { w2j.run(new ToolContext()); } catch (ToolException ex) { System.err.println(); System.err.println("WADLToJava Error: " + ex.getMessage()); System.err.println(); if (w2j.isVerbose()) { ex.printStackTrace(); } if (w2j.isExitOnFinish()) { System.exit(1); } } catch (Exception ex) { System.err.println("WADLToJava Error: " + ex.getMessage()); System.err.println(); if (w2j.isVerbose()) { ex.printStackTrace(); } if (w2j.isExitOnFinish()) { System.exit(1); } } }
public void printStackTrace(PrintStream ps) { if (!hasSuppressed) { super.printStackTrace(ps); return; } printStackTrace(ps, "", ""); } public void printStackTrace(PrintStream ps, String pfx, String cap) {
err.println("WSDLValidator Error : " + ex.getMessage()); if (ex.getCause() instanceof BadUsageException) { printUsageException(TOOL_NAME, (BadUsageException)ex.getCause()); err.println("[+] Verbose turned on"); err.println(); ex.printStackTrace(err);
err.println("Error : " + ex.getMessage()); if (ex.getCause() instanceof BadUsageException) { printUsageException(TOOL_NAME, (BadUsageException)ex.getCause()); ex.printStackTrace(err); ex.printStackTrace(err); throw new ToolException(ex.getMessage(), ex.getCause());
if (ex.getCause() instanceof BadUsageException) { printUsageException(TOOL_NAME, (BadUsageException)ex.getCause()); if (isVerboseOn()) { ex.printStackTrace(err); throw new ToolException(ex.getMessage(), ex.getCause()); } finally { tearDown();
public static void main(String[] pargs) { System.setProperty("org.apache.cxf.JDKBugHacks.defaultUsesCaches", "true"); CommandInterfaceUtils.commandCommonMain(); WSDLToJava w2j = new WSDLToJava(pargs); try { w2j.run(new ToolContext()); } catch (ToolException ex) { System.err.println(); System.err.println("WSDLToJava Error: " + ex.getMessage()); System.err.println(); if (w2j.isVerbose()) { ex.printStackTrace(); } if (w2j.isExitOnFinish()) { System.exit(1); } } catch (Exception ex) { System.err.println("WSDLToJava Error: " + ex.getMessage()); System.err.println(); if (w2j.isVerbose()) { ex.printStackTrace(); } if (w2j.isExitOnFinish()) { System.exit(1); } } }
public void printStackTrace(PrintStream ps, String pfx, String cap) { ps.println(pfx + cap + this); StackTraceElement[] trace = super.getStackTrace(); for (StackTraceElement traceElement : trace) { ps.println(pfx + "\tat " + traceElement); } // Print suppressed exceptions, if any for (Throwable se : suppressed) { printThrowable(se, ps, pfx + "\t", "Suppressed: "); } // Print cause, if any Throwable ourCause = getCause(); if (ourCause != null && (!hasSuppressed || ourCause != suppressed.get(0))) { printThrowable(ourCause, ps, pfx + "\t", "Caused by: "); } } private void printThrowable(Throwable t, PrintStream ps, String pfx, String cap) {
public void printStackTrace(PrintStream ps) { if (!hasSuppressed) { super.printStackTrace(ps); return; } printStackTrace(ps, "", ""); } public void printStackTrace(PrintStream ps, String pfx, String cap) {
public void throwToolException() { StringBuilder b = new StringBuilder(); for (ErrorInfo e : errors) { createMessage(b, e).append("\n"); } throw new ToolException(b.toString(), errors); } }
if (ex.getCause() instanceof BadUsageException) { printUsageException(TOOL_NAME, (BadUsageException)ex.getCause()); err.println("XSDToWSDL Error: " + ex.getMessage()); if (isVerboseOn()) { ex.printStackTrace(err);
public void execute(boolean exitOnFinish) throws ToolException { try { if (getArgument() != null) { super.execute(exitOnFinish); } execute(); } catch (ToolException ex) { if (ex.getCause() instanceof BadUsageException) { printUsageException(TOOL_NAME, (BadUsageException)ex.getCause()); } throw ex; } catch (Exception ex) { throw new ToolException(ex); } finally { tearDown(); } }