StreamUnsupportedException.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using System;
  2. using System.Runtime.Serialization;
  3. namespace System.Net.ApiService.Compression.Exceptions {
  4. /// <summary>
  5. /// Indicates that the input stream could not decoded due to known library incompability or missing features
  6. /// </summary>
  7. [Serializable]
  8. public class StreamUnsupportedException : StreamDecodingException
  9. {
  10. private const string GenericMessage = "Input stream is in a unsupported format";
  11. /// <summary>
  12. /// Initializes a new instance of the StreamUnsupportedException with a generic message
  13. /// </summary>
  14. public StreamUnsupportedException() : base(GenericMessage) { }
  15. /// <summary>
  16. /// Initializes a new instance of the StreamUnsupportedException class with a specified error message.
  17. /// </summary>
  18. /// <param name="message">A message describing the exception.</param>
  19. public StreamUnsupportedException(string message) : base(message) { }
  20. /// <summary>
  21. /// Initializes a new instance of the StreamUnsupportedException class with a specified
  22. /// error message and a reference to the inner exception that is the cause of this exception.
  23. /// </summary>
  24. /// <param name="message">A message describing the exception.</param>
  25. /// <param name="innerException">The inner exception</param>
  26. public StreamUnsupportedException(string message, Exception innerException) : base(message, innerException) { }
  27. /// <summary>
  28. /// Initializes a new instance of the StreamUnsupportedException class with serialized data.
  29. /// </summary>
  30. /// <param name="info">
  31. /// The System.Runtime.Serialization.SerializationInfo that holds the serialized
  32. /// object data about the exception being thrown.
  33. /// </param>
  34. /// <param name="context">
  35. /// The System.Runtime.Serialization.StreamingContext that contains contextual information
  36. /// about the source or destination.
  37. /// </param>
  38. protected StreamUnsupportedException(SerializationInfo info, StreamingContext context)
  39. : base(info, context)
  40. {
  41. }
  42. }
  43. }