Skip to content

Instantly share code, notes, and snippets.

@Lokutus
Created May 9, 2012 13:31
Show Gist options
  • Save Lokutus/2644512 to your computer and use it in GitHub Desktop.
Save Lokutus/2644512 to your computer and use it in GitHub Desktop.
public enum ErrorCodes
{
NotNumeric,
BadFormat,
ChecksumError
}
public class BarCodeException : ArgumentException
{
public ErrorCodes ErrorCode { get; private set; }
public BarCodeException()
: base() { }
public BarCodeException(string message)
: base(message) { }
public BarCodeException(string format, params object[] args)
: base(string.Format(format, args)) { }
public BarCodeException(string message, Exception innerException)
: base(message, innerException) { }
public BarCodeException(string format, Exception innerException, params object[] args)
: base(string.Format(format, args), innerException) { }
protected BarCodeException(System.Runtime.Serialization.SerializationInfo info, System.Runtime.Serialization.StreamingContext context)
: base(info, context) { }
public BarCodeException(ErrorCodes errorCode)
: base()
{
ErrorCode = errorCode;
}
public BarCodeException(string message, ErrorCodes errorCode)
: base(message)
{
ErrorCode = errorCode;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment