1 package com.github.triceo.splitlog.api; 2 3 import java.util.List; 4 5 /** 6 * Describes an exception instance. 7 * 8 */ 9 public interface ExceptionDescriptor { 10 11 /** 12 * Returns the cause for this exception. 13 * 14 * @return Exception data if {@link #isRootCause()} returns true, null 15 * otherwise. 16 */ 17 ExceptionDescriptor getCause(); 18 19 /** 20 * Best-effort attempt to provide an exception type for 21 * {@link #getExceptionClassName()}. 22 * 23 * @return Exception type if found on classpath, null otherwise. 24 */ 25 Class<? extends Throwable> getExceptionClass(); 26 27 String getExceptionClassName(); 28 29 String getMessage(); 30 31 /** 32 * This method will create a brand new unmodifiable list every time it is 33 * called. Use with caution. 34 * 35 * @return Unmodifiable representation of the stack trace. 36 */ 37 List<StackTraceElement> getStackTrace(); 38 39 boolean isRootCause(); 40 41 }