List of usage examples for java.lang Throwable getStackTrace
public StackTraceElement[] getStackTrace()
From source file:com.krawler.portal.util.ByteArrayMaker.java
private void _getInfo(Throwable t) { _initSize = buf.length;/*from w w w .jav a2 s .c o m*/ StackTraceElement[] elements = t.getStackTrace(); if (elements.length > 1) { StackTraceElement el = elements[1]; _caller = el.getClassName() + StringPool.PERIOD + el.getMethodName() + StringPool.COLON + el.getLineNumber(); } }
From source file:org.finra.jtaf.core.asserts.ErrorAccumulator.java
/** * Returns list of stack trace elements/*from ww w .j a va 2 s. c o m*/ * * @return */ public List<StackTraceElement[]> getErrorStackTraceElementsList() { List<StackTraceElement[]> list = new ArrayList<StackTraceElement[]>(); ArrayList<Throwable> errors = getErrors(); for (Throwable th : errors) { list.add(th.getStackTrace()); } return list; }
From source file:com.atinternet.tracker.CrashDetectionHandler.java
/** * Get the class name where the exception thrown * * @param t Throwable// ww w . j a va2 s . co m * @return String */ private String getClassNameException(Throwable t) { for (StackTraceElement element : t.getStackTrace()) { if (element.getClassName().contains(context.getApplicationContext().getPackageName())) { return element.getClassName(); } } return ""; }
From source file:org.amplafi.flow.validation.FlowValidationException.java
@Override public synchronized FlowValidationException initCause(Throwable cause) { super.initCause(cause); setStackTrace(cause.getStackTrace()); return this; }
From source file:org.eclipse.epp.internal.logging.aeri.ui.log.StandInStacktraceProvider.java
public void insertStandInStacktraceIfEmpty(final Status status, ServerConfiguration configuration) { if (requiresStandInStacktrace(status)) { Throwable syntetic = new StandInException(STAND_IN_MESSAGE); syntetic.fillInStackTrace();/*from w w w . ja v a2 s . c o m*/ StackTraceElement[] stacktrace = syntetic.getStackTrace(); StackTraceElement[] clearedStacktrace = clearBlacklistedTopStackframes(stacktrace, Constants.STAND_IN_STACKTRACE_BLACKLIST); syntetic.setStackTrace(clearedStacktrace); status.setException(Reports.newThrowable(syntetic)); status.setFingerprint(computeFingerprintFor(status, configuration)); } }
From source file:com.github.rozidan.springboot.logger.LoggerMsgFormatter.java
private int errLine(Throwable err) { if (err.getStackTrace().length > 0) { return err.getStackTrace()[0].getLineNumber(); }/* w w w . j av a 2s . com*/ return -1; }
From source file:com.github.rozidan.springboot.logger.LoggerMsgFormatter.java
private String errSourceClass(Throwable err) { if (err.getStackTrace().length > 0) { return err.getStackTrace()[0].getClassName(); }// w w w . jav a2s . c o m return "somewhere"; }
From source file:org.epsilonlabs.workflow.execution.example.GraphOutput.java
@Override public void onError(Throwable e) { e.printStackTrace();/* w ww .j a v a 2s.co m*/ notifyObserversOfStatusChange("task error:\n" + e.getStackTrace()); }
From source file:org.modeshape.web.jcr.rest.model.RestException.java
/** * Creates a new exception, based on an existing {@link Throwable} * * @param t a {@code non-null} {@link Exception} *///from w w w . ja v a2 s. c o m public RestException(Throwable t) { this.message = t.getMessage(); StringWriter stringWriter = new StringWriter(); for (StackTraceElement trace : t.getStackTrace()) { stringWriter.append(trace.toString()); } this.stackTrace = stringWriter.toString(); }
From source file:org.codehaus.groovy.grails.exceptions.DefaultStackTraceFilterer.java
public Throwable filter(Throwable source) { if (shouldFilter) { StackTraceElement[] trace = source.getStackTrace(); List<StackTraceElement> newTrace = filterTraceWithCutOff(trace, cutOffPackage); if (newTrace.isEmpty()) { // filter with no cut-off so at least there is some trace newTrace = filterTraceWithCutOff(trace, null); }/*from w w w . j av a 2 s. c o m*/ // Only trim the trace if there was some application trace on the stack // if not we will just skip sanitizing and leave it as is if (!newTrace.isEmpty()) { // We don't want to lose anything, so log it STACK_LOG.error(FULL_STACK_TRACE_MESSAGE, source); StackTraceElement[] clean = new StackTraceElement[newTrace.size()]; newTrace.toArray(clean); source.setStackTrace(clean); } } return source; }