You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

ProxyException.cs 1.4 kB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. using System;
  2. using System.Runtime.Serialization;
  3. namespace Shadowsocks.Common.SystemProxy
  4. {
  5. enum ProxyExceptionType
  6. {
  7. Unspecific,
  8. FailToRun,
  9. QueryReturnEmpty,
  10. SysproxyExitError,
  11. QueryReturnMalformed
  12. }
  13. class ProxyException : Exception
  14. {
  15. // provide more specific information about exception
  16. public ProxyExceptionType Type { get; }
  17. public ProxyException()
  18. {
  19. }
  20. public ProxyException(string message) : base(message)
  21. {
  22. }
  23. public ProxyException(string message, Exception innerException) : base(message, innerException)
  24. {
  25. }
  26. protected ProxyException(SerializationInfo info, StreamingContext context) : base(info, context)
  27. {
  28. }
  29. public ProxyException(ProxyExceptionType type)
  30. {
  31. this.Type = type;
  32. }
  33. public ProxyException(ProxyExceptionType type, string message) : base(message)
  34. {
  35. this.Type = type;
  36. }
  37. public ProxyException(ProxyExceptionType type, string message, Exception innerException) : base(message, innerException)
  38. {
  39. this.Type = type;
  40. }
  41. protected ProxyException(ProxyExceptionType type, SerializationInfo info, StreamingContext context) : base(info, context)
  42. {
  43. this.Type = type;
  44. }
  45. }
  46. }