< Summary

Information
Class: Renci.SshNet.Common.SshConnectionException
Assembly: Renci.SshNet
File(s): \home\appveyor\projects\ssh-net\src\Renci.SshNet\Common\SshConnectionException.cs
Line coverage
69%
Covered lines: 16
Uncovered lines: 7
Coverable lines: 23
Total lines: 87
Line coverage: 69.5%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Cyclomatic complexity Line coverage
get_DisconnectReason()100%1100%
.ctor()100%1100%
.ctor(...)100%1100%
.ctor(...)100%1100%
.ctor(...)100%10%
.ctor(...)100%1100%
.ctor(...)100%10%

File(s)

\home\appveyor\projects\ssh-net\src\Renci.SshNet\Common\SshConnectionException.cs

#LineLine coverage
 1using System;
 2#if FEATURE_BINARY_SERIALIZATION
 3using System.Runtime.Serialization;
 4#endif // FEATURE_BINARY_SERIALIZATION
 5using Renci.SshNet.Messages.Transport;
 6
 7namespace Renci.SshNet.Common
 8{
 9    /// <summary>
 10    /// The exception that is thrown when connection was terminated.
 11    /// </summary>
 12#if FEATURE_BINARY_SERIALIZATION
 13    [Serializable]
 14#endif // FEATURE_BINARY_SERIALIZATION
 15    public class SshConnectionException : SshException
 16    {
 17        /// <summary>
 18        /// Gets the disconnect reason if provided by the server or client. Otherwise None.
 19        /// </summary>
 261820        public DisconnectReason DisconnectReason { get; private set; }
 21
 22        /// <summary>
 23        /// Initializes a new instance of the <see cref="SshConnectionException"/> class.
 24        /// </summary>
 5425        public SshConnectionException()
 5426        {
 5427        }
 28
 29        /// <summary>
 30        /// Initializes a new instance of the <see cref="SshConnectionException"/> class.
 31        /// </summary>
 32        /// <param name="message">The message.</param>
 33        public SshConnectionException(string message)
 24234            : base(message)
 24235        {
 24236            DisconnectReason = DisconnectReason.None;
 24237        }
 38
 39        /// <summary>
 40        /// Initializes a new instance of the <see cref="SshConnectionException"/> class.
 41        /// </summary>
 42        /// <param name="message">The message.</param>
 43        /// <param name="disconnectReasonCode">The disconnect reason code.</param>
 44        public SshConnectionException(string message, DisconnectReason disconnectReasonCode)
 196645            : base(message)
 196646        {
 196647            DisconnectReason = disconnectReasonCode;
 196648        }
 49
 50        /// <summary>
 51        /// Initializes a new instance of the <see cref="SshConnectionException"/> class.
 52        /// </summary>
 53        /// <param name="message">The message.</param>
 54        /// <param name="inner">The inner.</param>
 55        public SshConnectionException(string message, Exception inner)
 056            : base(message, inner)
 057        {
 058            DisconnectReason = DisconnectReason.None;
 059        }
 60
 61        /// <summary>
 62        /// Initializes a new instance of the <see cref="SshConnectionException"/> class.
 63        /// </summary>
 64        /// <param name="message">The message.</param>
 65        /// <param name="disconnectReasonCode">The disconnect reason code.</param>
 66        /// <param name="inner">The inner.</param>
 67        public SshConnectionException(string message, DisconnectReason disconnectReasonCode, Exception inner)
 1668            : base(message, inner)
 1669        {
 1670            DisconnectReason = disconnectReasonCode;
 1671        }
 72
 73#if FEATURE_BINARY_SERIALIZATION
 74        /// <summary>
 75        /// Initializes a new instance of the <see cref="SshConnectionException"/> class.
 76        /// </summary>
 77        /// <param name="info">The <see cref="SerializationInfo"/> that holds the serialized object data about the excep
 78        /// <param name="context">The <see cref="StreamingContext"/> that contains contextual information about the sour
 79        /// <exception cref="ArgumentNullException">The <paramref name="info"/> parameter is <see langword="null"/>.</ex
 80        /// <exception cref="SerializationException">The class name is <see langword="null"/> or <see cref="Exception.HR
 81        protected SshConnectionException(SerializationInfo info, StreamingContext context)
 082            : base(info, context)
 083        {
 084        }
 85#endif // FEATURE_BINARY_SERIALIZATION
 86    }
 87}