public WstxException(String msg, Location loc, Throwable th) { super(msg, loc, th); mMsg = msg; // 13-Aug-2004, TSa: Better make sure root cause is set... ExceptionUtil.setInitCause(this, th); }
public WstxLazyException(XMLStreamException origEx) { super(origEx.getMessage()); mOrig = origEx; // Let's additionally to set source message ExceptionUtil.setInitCause(this, origEx); }
public WstxException(Throwable th) { super(th.getMessage(), th); mMsg = th.getMessage(); // 13-Aug-2004, TSa: Better make sure root cause is set... ExceptionUtil.setInitCause(this, th); }
/** * Helper method that tries to fully convert strange URL-specific exception * to more general IO exception. Also, to try to use JDK 1.4 feature without * creating requirement, uses reflection to try to set the root cause, if * we are running on JDK1.4 */ private static void throwIOException(Exception mex, String sysId) throws IOException { IOException ie = new IOException("[resolving systemId '"+sysId+"']: "+mex.toString()); ExceptionUtil.setInitCause(ie, mex); throw ie; } }
public static void throwAsIllegalArgument(Throwable t) { // Unchecked? Can re-throw as is throwIfUnchecked(t); // Otherwise, let's just change its type: IllegalArgumentException rex = new IllegalArgumentException("[was "+t.getClass()+"] "+t.getMessage()); // And indicate the root cause setInitCause(rex, t); throw rex; }
protected void throwFromStrE(XMLStreamException strex) throws WstxException { if (strex instanceof WstxException) { throw (WstxException) strex; } WstxException newEx = new WstxException(strex); ExceptionUtil.setInitCause(newEx, strex); throw newEx; }
private void throwSaxException(Exception src) throws SAXException { SAXParseException se = new SAXParseException(src.getMessage(), /*(Locator)*/ this, src); ExceptionUtil.setInitCause(se, src); if (mErrorHandler != null) { mErrorHandler.fatalError(se); } throw se; }
/** * Method that can be used to convert any Throwable to a RuntimeException; * conversion is only done for checked exceptions. */ public static void throwRuntimeException(Throwable t) { // Unchecked? Can re-throw as is throwIfUnchecked(t); // Otherwise, let's just change its type: RuntimeException rex = new RuntimeException("[was "+t.getClass()+"] "+t.getMessage()); // And indicate the root cause setInitCause(rex, t); throw rex; }
} catch (IOException ioe) { SAXException saxe = new SAXException(ioe); ExceptionUtil.setInitCause(saxe, ioe); throw saxe;
public static IOException constructIOException(String msg, Throwable src) { /* Stupid IOException constructors... only 1.6 has * what we need. Hence must set root cause explicitly * as we have to support JDK 1.5. */ IOException e = new IOException(msg); setInitCause(e, src); return e; }
public WstxLazyException(XMLStreamException origEx) { super(origEx.getMessage()); mOrig = origEx; // Let's additionally to set source message ExceptionUtil.setInitCause(this, origEx); }
public static IOException constructIOException(String msg, Throwable src) { /* Stupid IOException constructors... only 1.6 has * what we need. Hence must set root cause explicitly * as we have to support JDK 1.5. */ IOException e = new IOException(msg); setInitCause(e, src); return e; }
public static IOException constructIOException(String msg, Throwable src) { /* Stupid IOException constructors... only 1.6 has * what we need. Hence must set root cause explicitly * as we have to support JDK 1.5. */ IOException e = new IOException(msg); setInitCause(e, src); return e; }
public WstxException(Throwable th) { super(th.getMessage(), th); mMsg = th.getMessage(); // 13-Aug-2004, TSa: Better make sure root cause is set... ExceptionUtil.setInitCause(this, th); }
public static void throwAsIllegalArgument(Throwable t) { // Unchecked? Can re-throw as is throwIfUnchecked(t); // Otherwise, let's just change its type: IllegalArgumentException rex = new IllegalArgumentException("[was "+t.getClass()+"] "+t.getMessage()); // And indicate the root cause setInitCause(rex, t); throw rex; }
private void throwSaxException(Exception src) throws SAXException { SAXParseException se = new SAXParseException(src.getMessage(), /*(Locator)*/ this, src); ExceptionUtil.setInitCause(se, src); if (mErrorHandler != null) { mErrorHandler.fatalError(se); } throw se; }
public static void throwAsIllegalArgument(Throwable t) { // Unchecked? Can re-throw as is throwIfUnchecked(t); // Otherwise, let's just change its type: IllegalArgumentException rex = new IllegalArgumentException("[was "+t.getClass()+"] "+t.getMessage()); // And indicate the root cause setInitCause(rex, t); throw rex; }
protected void throwFromStrE(XMLStreamException strex) throws WstxException { if (strex instanceof WstxException) { throw (WstxException) strex; } WstxException newEx = new WstxException(strex); ExceptionUtil.setInitCause(newEx, strex); throw newEx; }
private void throwSaxException(Exception src) throws SAXException { SAXParseException se = new SAXParseException(src.getMessage(), /*(Locator)*/ this, src); ExceptionUtil.setInitCause(se, src); if (mErrorHandler != null) { mErrorHandler.fatalError(se); } throw se; }
public static void throwAsIllegalArgument(Throwable t) { // Unchecked? Can re-throw as is throwIfUnchecked(t); // Otherwise, let's just change its type: IllegalArgumentException rex = new IllegalArgumentException("[was "+t.getClass()+"] "+t.getMessage()); // And indicate the root cause setInitCause(rex, t); throw rex; }