Codota Logo
Throwable.printStackTrace
Code IndexAdd Codota to your IDE (free)

How to use
printStackTrace
method
in
java.lang.Throwable

Best Java code snippets using java.lang.Throwable.printStackTrace (Showing top 20 results out of 54,171)

  • Common ways to obtain Throwable
private void myMethod () {
Throwable t =
  • Codota IconInvocationTargetException e;e.getTargetException()
  • Codota IconInvocationTargetException e;e.getCause()
  • Codota IconException e;e.getCause()
  • Smart code suggestions by Codota
}
origin: ReactiveX/RxJava

  @Override
  public void accept(Throwable t1) {
    t1.printStackTrace();
  }
},
origin: ReactiveX/RxJava

  @Override
  public void accept(Throwable t1) {
    t1.printStackTrace();
  }
},
origin: ReactiveX/RxJava

@Override
public void onError(Throwable e) {
  e.printStackTrace();
  latch.countDown();
}
origin: ReactiveX/RxJava

@Override
public void onError(Throwable e) {
  e.printStackTrace();
  latch.countDown();
}
origin: ReactiveX/RxJava

@Override
public void onError(Throwable e) {
  e.printStackTrace();
  latch.countDown();
}
origin: ReactiveX/RxJava

@Override
public void onError(Throwable e) {
  e.printStackTrace();
  latch.countDown();
}
origin: ReactiveX/RxJava

  @Override
  public void onError(Throwable e) {
    count.decrementAndGet();
    e.printStackTrace();
  }
});
origin: ReactiveX/RxJava

@Override
public void onError(Throwable e) {
  error.set(e);
  System.out.println("error");
  e.printStackTrace();
}
origin: ReactiveX/RxJava

@Override
public void onError(Throwable e) {
  System.out.println("error: " + e.getMessage());
  e.printStackTrace();
}
origin: ReactiveX/RxJava

@Override
public void onError(Throwable e) {
  error.set(e);
  System.out.println("error");
  e.printStackTrace();
}
origin: ReactiveX/RxJava

private static void waitOnThreads(Future<?>... futures) {
  for (Future<?> f : futures) {
    try {
      f.get(20, TimeUnit.SECONDS);
    } catch (Throwable e) {
      System.err.println("Failed while waiting on future.");
      e.printStackTrace();
    }
  }
}
origin: ReactiveX/RxJava

@Override
public void onError(Throwable e) {
  error.set(e);
  System.out.println("error");
  e.printStackTrace();
}
origin: ReactiveX/RxJava

private static void waitOnThreads(Future<?>... futures) {
  for (Future<?> f : futures) {
    try {
      f.get(20, TimeUnit.SECONDS);
    } catch (Throwable e) {
      System.err.println("Failed while waiting on future.");
      e.printStackTrace();
    }
  }
}
origin: ReactiveX/RxJava

public static String stackTraceAsString(Throwable e) {
  StringWriter sw = new StringWriter();
  e.printStackTrace(new PrintWriter(sw));
  return sw.toString();
}
origin: ReactiveX/RxJava

@Override
public void onError(Throwable e) {
  error.set(e);
  System.out.println("error");
  e.printStackTrace();
  latch.countDown();
}
origin: ReactiveX/RxJava

/**
 * This hijacks the Throwable.printStackTrace() output and puts it in a string, where we can look for
 * "CIRCULAR REFERENCE" (a String added by Throwable.printEnclosedStackTrace)
 */
private static void assertNoCircularReferences(Throwable ex) {
  ByteArrayOutputStream baos = new ByteArrayOutputStream();
  PrintStream printStream = new PrintStream(baos);
  ex.printStackTrace(printStream);
  assertFalse(baos.toString().contains("CIRCULAR REFERENCE"));
}
origin: ReactiveX/RxJava

@Test(timeout = 1000)
public void testCompositeExceptionFromParentThenChild() {
  CompositeException cex = new CompositeException(ex1, ex2);
  System.err.println("----------------------------- print composite stacktrace");
  cex.printStackTrace();
  assertEquals(2, cex.getExceptions().size());
  assertNoCircularReferences(cex);
  assertNotNull(getRootCause(cex));
  System.err.println("----------------------------- print cause stacktrace");
  cex.getCause().printStackTrace();
}
origin: ReactiveX/RxJava

@Test(timeout = 1000)
public void testCompositeExceptionFromChildThenParent() {
  CompositeException cex = new CompositeException(ex2, ex1);
  System.err.println("----------------------------- print composite stacktrace");
  cex.printStackTrace();
  assertEquals(2, cex.getExceptions().size());
  assertNoCircularReferences(cex);
  assertNotNull(getRootCause(cex));
  System.err.println("----------------------------- print cause stacktrace");
  cex.getCause().printStackTrace();
}
origin: ReactiveX/RxJava

@Test(timeout = 1000)
public void testCompositeExceptionFromChildAndComposite() {
  CompositeException cex = new CompositeException(ex1, getNewCompositeExceptionWithEx123());
  System.err.println("----------------------------- print composite stacktrace");
  cex.printStackTrace();
  assertEquals(3, cex.getExceptions().size());
  assertNoCircularReferences(cex);
  assertNotNull(getRootCause(cex));
  System.err.println("----------------------------- print cause stacktrace");
  cex.getCause().printStackTrace();
}
origin: ReactiveX/RxJava

@Test(timeout = 1000)
public void testCompositeExceptionFromCompositeAndChild() {
  CompositeException cex = new CompositeException(getNewCompositeExceptionWithEx123(), ex1);
  System.err.println("----------------------------- print composite stacktrace");
  cex.printStackTrace();
  assertEquals(3, cex.getExceptions().size());
  assertNoCircularReferences(cex);
  assertNotNull(getRootCause(cex));
  System.err.println("----------------------------- print cause stacktrace");
  cex.getCause().printStackTrace();
}
java.langThrowableprintStackTrace

Javadoc

Writes a printable representation of this Throwable's stack trace to the System.err stream.

Popular methods of Throwable

  • getMessage
    Returns the detail message string of this throwable.
  • getCause
    Returns the cause of this throwable or null if the cause is nonexistent or unknown. (The cause is th
  • toString
    Returns a short description of this throwable. The result is the concatenation of: * the Class#getN
  • getStackTrace
    Provides programmatic access to the stack trace information printed by #printStackTrace(). Returns a
  • <init>
    Constructs a new throwable with the specified cause and a detail message of (cause==null ? null : ca
  • getLocalizedMessage
    Creates a localized description of this throwable. Subclasses may override this method in order to p
  • setStackTrace
    Sets the stack trace elements that will be returned by #getStackTrace() and printed by #printStackTr
  • addSuppressed
    Appends the specified exception to the exceptions that were suppressed in order to deliver this exce
  • initCause
    Initializes the cause of this throwable to the specified value. (The cause is the throwable that cau
  • fillInStackTrace
  • getSuppressed
    Returns the throwables suppressed by this.
  • countDuplicates
    Counts the number of duplicate stack frames, starting from the end of the stack.
  • getSuppressed,
  • countDuplicates,
  • getInternalStackTrace,
  • nativeFillInStackTrace,
  • nativeGetStackTrace,
  • fillInStackTrace0,
  • genStackTrace,
  • genStackTraceFromError,
  • getOurStackTrace

Popular in Java

  • Reading from database using SQL prepared statement
  • startActivity (Activity)
  • getSupportFragmentManager (FragmentActivity)
    Return the FragmentManager for interacting with fragments associated with this activity.
  • scheduleAtFixedRate (Timer)
    Schedules the specified task for repeated fixed-rate execution, beginning after the specified delay.
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Menu (java.awt)
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Properties (java.util)
    The Properties class represents a persistent set of properties. The Properties can be saved to a st
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now