/** * Returns the error message of this and any nested <code>Throwable</code>s in an array of Strings, one element * for each message. Any <code>Throwable</code> not containing a message is represented in the array by a null. * This has the effect of cause the length of the returned array to be equal to the result of the * {@link #getThrowableCount()} operation. * * @return the error messages * @since 2.0 */ public String[] getMessages() { Throwable[] throwables = this.getThrowables(); String[] msgs = new String[throwables.length]; for (int i = 0; i < throwables.length; i++) { msgs[i] = (Nestable.class.isInstance(throwables[i]) ? ((Nestable) throwables[i]).getMessage(0) : throwables[i].getMessage()); } return msgs; }
/** * Returns the error message of the <code>Throwable</code> in the chain of <code>Throwable</code>s at the * specified index, numbered from 0. * * @param index * the index of the <code>Throwable</code> in the chain of <code>Throwable</code>s * @return the error message, or null if the <code>Throwable</code> at the specified index in the chain does not * contain a message * @throws IndexOutOfBoundsException * if the <code>index</code> argument is negative or not less than the count of <code>Throwable</code>s * in the chain * @since 2.0 */ public String getMessage(int index) { Throwable t = this.getThrowable(index); if (Nestable.class.isInstance(t)) { return ((Nestable) t).getMessage(0); } return t.getMessage(); }
/** * Returns the error message of this and any nested <code>Throwable</code>s in an array of Strings, one element * for each message. Any <code>Throwable</code> not containing a message is represented in the array by a null. * This has the effect of cause the length of the returned array to be equal to the result of the * {@link #getThrowableCount()} operation. * * @return the error messages * @since 2.0 */ public String[] getMessages() { Throwable[] throwables = this.getThrowables(); String[] msgs = new String[throwables.length]; for (int i = 0; i < throwables.length; i++) { msgs[i] = (Nestable.class.isInstance(throwables[i]) ? ((Nestable) throwables[i]).getMessage(0) : throwables[i].getMessage()); } return msgs; }
/** * Returns the error message of this and any nested <code>Throwable</code>s in an array of Strings, one element * for each message. Any <code>Throwable</code> not containing a message is represented in the array by a null. * This has the effect of cause the length of the returned array to be equal to the result of the * {@link #getThrowableCount()} operation. * * @return the error messages * @since 2.0 */ public String[] getMessages() { Throwable[] throwables = this.getThrowables(); String[] msgs = new String[throwables.length]; for (int i = 0; i < throwables.length; i++) { msgs[i] = (Nestable.class.isInstance(throwables[i]) ? ((Nestable) throwables[i]).getMessage(0) : throwables[i].getMessage()); } return msgs; }
/** * Returns the error message of this and any nested <code>Throwable</code>s in an array of Strings, one element * for each message. Any <code>Throwable</code> not containing a message is represented in the array by a null. * This has the effect of cause the length of the returned array to be equal to the result of the * {@link #getThrowableCount()} operation. * * @return the error messages * @since 2.0 */ public String[] getMessages() { Throwable[] throwables = this.getThrowables(); String[] msgs = new String[throwables.length]; for (int i = 0; i < throwables.length; i++) { msgs[i] = (Nestable.class.isInstance(throwables[i]) ? ((Nestable) throwables[i]).getMessage(0) : throwables[i].getMessage()); } return msgs; }
/** * Returns the error message of the <code>Throwable</code> in the chain of <code>Throwable</code>s at the * specified index, numbered from 0. * * @param index * the index of the <code>Throwable</code> in the chain of <code>Throwable</code>s * @return the error message, or null if the <code>Throwable</code> at the specified index in the chain does not * contain a message * @throws IndexOutOfBoundsException * if the <code>index</code> argument is negative or not less than the count of <code>Throwable</code>s * in the chain * @since 2.0 */ public String getMessage(int index) { Throwable t = this.getThrowable(index); if (Nestable.class.isInstance(t)) { return ((Nestable) t).getMessage(0); } return t.getMessage(); }
/** * Returns the error message of the <code>Throwable</code> in the chain of <code>Throwable</code>s at the * specified index, numbered from 0. * * @param index * the index of the <code>Throwable</code> in the chain of <code>Throwable</code>s * @return the error message, or null if the <code>Throwable</code> at the specified index in the chain does not * contain a message * @throws IndexOutOfBoundsException * if the <code>index</code> argument is negative or not less than the count of <code>Throwable</code>s * in the chain * @since 2.0 */ public String getMessage(int index) { Throwable t = this.getThrowable(index); if (Nestable.class.isInstance(t)) { return ((Nestable) t).getMessage(0); } return t.getMessage(); }
/** * Returns the error message of the <code>Throwable</code> in the chain of <code>Throwable</code>s at the * specified index, numbered from 0. * * @param index * the index of the <code>Throwable</code> in the chain of <code>Throwable</code>s * @return the error message, or null if the <code>Throwable</code> at the specified index in the chain does not * contain a message * @throws IndexOutOfBoundsException * if the <code>index</code> argument is negative or not less than the count of <code>Throwable</code>s * in the chain * @since 2.0 */ public String getMessage(int index) { Throwable t = this.getThrowable(index); if (Nestable.class.isInstance(t)) { return ((Nestable) t).getMessage(0); } return t.getMessage(); }
/** * Returns the error message of the <code>Throwable</code> in the chain of <code>Throwable</code>s at the * specified index, numbered from 0. * * @param index * the index of the <code>Throwable</code> in the chain of <code>Throwable</code>s * @return the error message, or null if the <code>Throwable</code> at the specified index in the chain does not * contain a message * @throws IndexOutOfBoundsException * if the <code>index</code> argument is negative or not less than the count of <code>Throwable</code>s * in the chain * @since 2.0 */ public String getMessage(int index) { Throwable t = this.getThrowable(index); if (Nestable.class.isInstance(t)) { return ((Nestable) t).getMessage(0); } return t.getMessage(); }
/** * Returns the error message of this and any nested <code>Throwable</code>s in an array of Strings, one element * for each message. Any <code>Throwable</code> not containing a message is represented in the array by a null. * This has the effect of cause the length of the returned array to be equal to the result of the * {@link #getThrowableCount()} operation. * * @return the error messages * @since 2.0 */ public String[] getMessages() { Throwable[] throwables = this.getThrowables(); String[] msgs = new String[throwables.length]; for (int i = 0; i < throwables.length; i++) { msgs[i] = (Nestable.class.isInstance(throwables[i]) ? ((Nestable) throwables[i]).getMessage(0) : throwables[i].getMessage()); } return msgs; }
/** * Returns the error message of the <code>Throwable</code> in the chain of <code>Throwable</code>s at the * specified index, numbered from 0. * * @param index * the index of the <code>Throwable</code> in the chain of <code>Throwable</code>s * @return the error message, or null if the <code>Throwable</code> at the specified index in the chain does not * contain a message * @throws IndexOutOfBoundsException * if the <code>index</code> argument is negative or not less than the count of <code>Throwable</code>s * in the chain * @since 2.0 */ public String getMessage(int index) { Throwable t = this.getThrowable(index); if (Nestable.class.isInstance(t)) { return ((Nestable) t).getMessage(0); } return t.getMessage(); }
/** * Returns the error message of this and any nested <code>Throwable</code>s in an array of Strings, one element * for each message. Any <code>Throwable</code> not containing a message is represented in the array by a null. * This has the effect of cause the length of the returned array to be equal to the result of the * {@link #getThrowableCount()} operation. * * @return the error messages * @since 2.0 */ public String[] getMessages() { Throwable[] throwables = this.getThrowables(); String[] msgs = new String[throwables.length]; for (int i = 0; i < throwables.length; i++) { msgs[i] = (Nestable.class.isInstance(throwables[i]) ? ((Nestable) throwables[i]).getMessage(0) : throwables[i].getMessage()); } return msgs; }