1 using System; 2 3 namespace BencodeNET 4 { 5 /// <summary> 6 /// Represents generic errors in this bencode library. 7 /// </summary> 8 public class BencodeException : Exception 9 { BencodeException()10 public BencodeException() 11 { 12 } 13 BencodeException(string message)14 public BencodeException(string message) : base(message) 15 { 16 } 17 BencodeException(string message, Exception inner)18 public BencodeException(string message, Exception inner) : base(message, inner) 19 { 20 } 21 } 22 23 /// <summary> 24 /// Represents generic errors in this bencode library related to a specific <see cref="Type"/>. 25 /// </summary> 26 /// <typeparam name="T">The related type.</typeparam> 27 public class BencodeException<T> : BencodeException 28 { 29 private readonly Type fRelatedType = typeof(T); 30 31 /// <summary> 32 /// The type related to this error. Usually the type being parsed. 33 /// </summary> 34 public Type RelatedType 35 { 36 get { return fRelatedType; } 37 } 38 BencodeException()39 public BencodeException() 40 { 41 } 42 BencodeException(string message)43 public BencodeException(string message) : base(message) 44 { 45 } 46 BencodeException(string message, Exception inner)47 public BencodeException(string message, Exception inner) : base(message, inner) 48 { 49 } 50 } 51 } 52