List of usage examples for java.lang Throwable getMessage
public String getMessage()
From source file:eu.interedition.collatex.tools.CollateX.java
public static void error(String str, Throwable t) { ERROR_LOG.println(str); ERROR_LOG.println(t.getMessage()); }
From source file:Main.java
public static void throwAsIAE(Throwable paramThrowable) { throwAsIAE(paramThrowable, paramThrowable.getMessage()); }
From source file:com.infullmobile.jenkins.plugin.restrictedregister.util.Utils.java
public static void logError(Throwable t) { final String ret = t.getMessage() + "\n" + ExceptionUtils.getFullStackTrace(t); logError(ret);/*w w w . ja v a 2 s.co m*/ }
From source file:com.aw.swing.mvp.ui.common.LabelResolver.java
public static String getCodigoFromProperties(String fieldName) { try {/* ww w .j a v a 2 s .co m*/ return MsgDisplayer.getMessage(fieldName, null); } catch (Throwable e) { logger.warn(e.getMessage()); } return MsgDisplayer.getMessage("sw.error.field", null); }
From source file:com.github.rnewson.couchdb.lucene.Utils.java
public static String throwableToJSON(final Throwable t) { return error( t.getMessage() == null ? "Unknown error" : String.format("%s: %s", t.getClass(), t.getMessage())); }
From source file:Main.java
static public void saveCrashTrace(Throwable ex) { StackTraceElement[] elements = ex.getStackTrace(); StringBuilder builder = new StringBuilder(ex.getMessage()); for (StackTraceElement ele : elements) { builder.append('\n').append(ele.toString()); }// w w w .ja va 2s. c o m android.util.Log.e("crash", builder.toString()); }
From source file:com.addbean.autils.tools.CharsetUtils.java
public static String toCharset(final String str, final String charset, int judgeCharsetLength) { try {/*ww w .ja v a 2 s . co m*/ String oldCharset = getEncoding(str, judgeCharsetLength); return new String(str.getBytes(oldCharset), charset); } catch (Throwable ex) { Log.e("CharsetUtils", ex.getMessage()); return str; } }
From source file:Main.java
public static void printTree(Node doc) { if (doc == null) { System.out.println("Nothing to print!!"); return;//from w w w .j av a 2s . c o m } try { System.out.println(doc.getNodeName() + " " + doc.getNodeValue()); NamedNodeMap cl = doc.getAttributes(); for (int i = 0; i < cl.getLength(); i++) { Node node = cl.item(i); System.out.println("\t" + node.getNodeName() + " ->" + node.getNodeValue()); } NodeList nl = doc.getChildNodes(); for (int i = 0; i < nl.getLength(); i++) { Node node = nl.item(i); printTree(node); } } catch (Throwable e) { System.out.println("Cannot print!! " + e.getMessage()); } }
From source file:org.jenkinsci.plugins.uithemes.rest.model.StatusResponse.java
public static StatusResponse ERROR(Throwable t) { return ERROR(t.getMessage(), t); }
From source file:com.notonthehighstreet.ratel.internal.model.Error.java
public static Error fromException(final Throwable e) { return new Error(e.getClass().getName(), e.getMessage(), unwrapStackTrace(e)); }