SevenZipCompressionFailedException.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #if UNMANAGED
  2. namespace SevenZip
  3. {
  4. using System;
  5. using System.Runtime.Serialization;
  6. /// <summary>
  7. /// Exception class for fail to create an archive in SevenZipCompressor.
  8. /// </summary>
  9. [Serializable]
  10. public class SevenZipCompressionFailedException : SevenZipException
  11. {
  12. /// <summary>
  13. /// Exception default message which is displayed if no extra information is specified
  14. /// </summary>
  15. public const string DEFAULT_MESSAGE = "The compression has failed for an unknown reason with code ";
  16. /// <summary>
  17. /// Initializes a new instance of the SevenZipCompressionFailedException class
  18. /// </summary>
  19. public SevenZipCompressionFailedException() : base(DEFAULT_MESSAGE) { }
  20. /// <summary>
  21. /// Initializes a new instance of the SevenZipCompressionFailedException class
  22. /// </summary>
  23. /// <param name="message">Additional detailed message</param>
  24. public SevenZipCompressionFailedException(string message) : base(DEFAULT_MESSAGE, message) { }
  25. /// <summary>
  26. /// Initializes a new instance of the SevenZipCompressionFailedException class
  27. /// </summary>
  28. /// <param name="message">Additional detailed message</param>
  29. /// <param name="inner">Inner exception occurred</param>
  30. public SevenZipCompressionFailedException(string message, Exception inner)
  31. : base(DEFAULT_MESSAGE, message, inner) { }
  32. /// <summary>
  33. /// Initializes a new instance of the SevenZipCompressionFailedException class
  34. /// </summary>
  35. /// <param name="info">All data needed for serialization or deserialization</param>
  36. /// <param name="context">Serialized stream descriptor</param>
  37. protected SevenZipCompressionFailedException(
  38. SerializationInfo info, StreamingContext context)
  39. : base(info, context) { }
  40. }
  41. }
  42. #endif