LibUsbDotNet/LibUsbDotNet/LibUsb/ErrorExtensions.cs
/// <summary>
/// Throws a <see cref="UsbException"/> if the value of <paramref name="error"/> is not <see cref="Error.Success"/>.
/// </summary>
/// <param name="error">
/// The error code based on which to throw an exception.
/// </param>
Throws a  if the value of  is not .
Throws a if the value of is not .
public static void ThrowOnError(this Error error)
        {
            if (error != Error.Success)
            {
                throw new UsbException(error);
            }
        }
public static void ThrowOnError ( this Error error ) { if ( error != Error . Success ) { throw new UsbException ( error ) ; } }
Throws a  if the value of  is not .
Throws a if the value of is not .
Error
this
error
The error code based on which to throw an exception.
The error code based on which to throw an exception .