ScpException.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using System;
  2. #if FEATURE_BINARY_SERIALIZATION
  3. using System.Runtime.Serialization;
  4. #endif // FEATURE_BINARY_SERIALIZATION
  5. namespace Renci.SshNet.Common
  6. {
  7. /// <summary>
  8. /// The exception that is thrown when SCP error occurred.
  9. /// </summary>
  10. #if FEATURE_BINARY_SERIALIZATION
  11. [Serializable]
  12. #endif // FEATURE_BINARY_SERIALIZATION
  13. public class ScpException : SshException
  14. {
  15. /// <summary>
  16. /// Initializes a new instance of the <see cref="ScpException"/> class.
  17. /// </summary>
  18. public ScpException()
  19. {
  20. }
  21. /// <summary>
  22. /// Initializes a new instance of the <see cref="ScpException"/> class.
  23. /// </summary>
  24. /// <param name="message">The message.</param>
  25. public ScpException(string message)
  26. : base(message)
  27. {
  28. }
  29. /// <summary>
  30. /// Initializes a new instance of the <see cref="ScpException"/> class.
  31. /// </summary>
  32. /// <param name="message">The message.</param>
  33. /// <param name="innerException">The inner exception.</param>
  34. public ScpException(string message, Exception innerException)
  35. : base(message, innerException)
  36. {
  37. }
  38. #if FEATURE_BINARY_SERIALIZATION
  39. /// <summary>
  40. /// Initializes a new instance of the <see cref="ScpException"/> class.
  41. /// </summary>
  42. /// <param name="info">The <see cref="SerializationInfo"/> that holds the serialized object data about the exception being thrown.</param>
  43. /// <param name="context">The <see cref="StreamingContext"/> that contains contextual information about the source or destination.</param>
  44. /// <exception cref="ArgumentNullException">The <paramref name="info"/> parameter is <see langword="null"/>.</exception>
  45. /// <exception cref="SerializationException">The class name is <see langword="null"/> or <see cref="Exception.HResult"/> is zero (0). </exception>
  46. protected ScpException(SerializationInfo info, StreamingContext context)
  47. : base(info, context)
  48. {
  49. }
  50. #endif // FEATURE_BINARY_SERIALIZATION
  51. }
  52. }