@@ -0,0 +1,1538 @@
+/*%0A * Copyright 2014 Klaus Reimer %3Ck@ailis.de%3E%0A * See LICENSE.md for licensing information.%0A */%0A%0Apackage org.usb4java;%0A%0A/**%0A * A runtime exception which automatically outputs the libusb error string.%0A *%0A * @author Klaus Reimer (k@ailis.de)%0A */%0Apublic final class LibUsbException extends RuntimeException%0A%7B%0A    /** Serial version UID. */%0A    private static final long serialVersionUID = 1L;%0A%0A    /** The libusb error code. */%0A    private final int errorCode;%0A    %0A    /**%0A     * Constructs a libusb exception which just outputs the error code and%0A     * the error message from libusb.%0A     *%0A     * @param errorCode%0A     *            The error code.%0A     */%0A    public LibUsbException(final int errorCode)%0A    %7B%0A        super(String.format(%22USB error %25d: %25s%22, -errorCode,%0A            LibUsb.strError(errorCode)));%0A        this.errorCode = errorCode;%0A    %7D%0A%0A    /**%0A     * Constructs a libusb exception which outputs the error code and%0A     * the error message from libusb together with a custom error message.%0A     *%0A     * @param message%0A     *            The error message.%0A     * @param errorCode%0A     *            The error code.%0A     */%0A    public LibUsbException(final String message, final int errorCode)%0A    %7B%0A        super(String.format(%22USB error %25d: %25s: %25s%22, -errorCode, message,%0A            LibUsb.strError(errorCode)));%0A        this.errorCode = errorCode;%0A    %7D%0A%0A    /**%0A     * Returns the error code.%0A     *%0A     * @return The error code%0A     */%0A    public int getErrorCode()%0A    %7B%0A        return this.errorCode;%0A    %7D    %0A%7D%0A

Add LibUsbException for easier error code handling