Example #1
0
 /// <summary>
 ///     Initializes a new instance of the <see cref="LdapException" /> class.
 ///     Constructs an exception with a detailed message obtained from the
 ///     specified <c>MessageOrKey</c> String.
 ///     Additional parameters specify the result code, the message returned
 ///     from the server, and a matchedDN returned from the server.
 ///     The String is used either as a message key to obtain a localized
 ///     messsage from ExceptionMessages, or if there is no key in the
 ///     resource matching the text, it is used as the detailed message itself.
 /// </summary>
 /// <param name="message">The message.</param>
 /// <param name="resultCode">The result code returned.</param>
 /// <param name="serverMsg">
 ///     Error message specifying additional information
 ///     from the server.
 /// </param>
 /// <param name="matchedDN">
 ///     The maximal subset of a specified DN which could
 ///     be matched by the server on a search operation.
 /// </param>
 /// <param name="rootException">The root exception.</param>
 public LdapException(string message, LdapStatusCode resultCode, string serverMsg = null, string matchedDN = null, Exception rootException = null)
     : base(message)
 {
     ResultCode     = resultCode;
     Cause          = rootException;
     MatchedDN      = matchedDN;
     _serverMessage = serverMsg;
 }
Example #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LdapException" /> class.
 /// Constructs an exception with a detailed message obtained from the
 /// specified <code>MessageOrKey</code> String.
 /// Additional parameters specify the result code, the message returned
 /// from the server, and a matchedDN returned from the server.
 /// The String is used either as a message key to obtain a localized
 /// messsage from ExceptionMessages, or if there is no key in the
 /// resource matching the text, it is used as the detailed message itself.
 /// </summary>
 /// <param name="message">The message.</param>
 /// <param name="resultCode">The result code returned.</param>
 /// <param name="serverMsg">Error message specifying additional information
 /// from the server</param>
 /// <param name="matchedDN">The maximal subset of a specified DN which could
 /// be matched by the server on a search operation.</param>
 /// <param name="rootException">The root exception.</param>
 public LdapException(string message, LdapStatusCode resultCode, string serverMsg = null,
                      string matchedDN = null, Exception rootException = null)
     : base(message)
 {
     this.resultCode    = resultCode;
     this.rootException = rootException;
     this.matchedDN     = matchedDN;
     serverMessage      = serverMsg;
 }
Example #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LdapLocalException" /> class.
 /// Constructs a local exception with a detailed message obtained from the
 /// specified <code>MessageOrKey</code> String.
 /// Additional parameters specify the result code and a rootException which
 /// is the underlying cause of an error on the client.
 /// The String is used either as a message key to obtain a localized
 /// message from ExceptionMessages, or if there is no key in the
 /// resource matching the text, it is used as the detailed message itself.
 /// </summary>
 /// <param name="message">The message.</param>
 /// <param name="resultCode">The result code returned.</param>
 /// <param name="rootException">A throwable which is the underlying cause
 /// of the LdapException.</param>
 public LdapLocalException(string message, LdapStatusCode resultCode, Exception rootException = null)
     : base(message, resultCode, rootException: rootException)
 {
 }
Example #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="LdapReferralException" /> class.
 /// Constructs an exception with a specified error string, result code,
 /// an error message from the server, and an exception that indicates
 /// a failure to follow a referral.
 /// </summary>
 /// <param name="message">The additional error information.</param>
 /// <param name="resultCode">The result code returned.</param>
 /// <param name="serverMessage">Error message specifying additional information
 /// from the server.</param>
 /// <param name="rootException">The root exception.</param>
 public LdapReferralException(string message, LdapStatusCode resultCode, string serverMessage,
                              Exception rootException = null)
     : base(message, resultCode, serverMessage, rootException: rootException)
 {
 }