Item 75: Include failure-capture information in detail messages

75. Include error log information in detailed messages

    /**
     * Constructs a new {@code IndexOutOfBoundsException} class with an
     * argument indicating the illegal index.
     *
     * <p>The index is included in this exception's detail message.  The
     * exact presentation format of the detail message is unspecified.
     *
     * @param index the illegal index.
     * @since 9
     */
    public IndexOutOfBoundsException(int index) {
        super("Index out of range: " + index);
    }

Recommended Posts

Item 75: Include failure-capture information in detail messages
Mask confidential information in log messages with Logback