Exemplo n.º 1
0
 public static void ThrowOnError(this SyslogRelayError value, string message)
 {
     if ((value != SyslogRelayError.Success))
     {
         throw new SyslogRelayException(value, message);
     }
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="SyslogRelayException"/> class with a specified error code and error message.
 /// <summary>
 /// <param name="error">
 /// The error code of the error that occurred.
 /// </param>
 /// <param name="message">
 /// A message which describes the error.
 /// </param>
 public SyslogRelayException(SyslogRelayError error, string message) :
     base(string.Format("An SyslogRelay error occurred. {1}. The error code was {0}", error, message))
 {
     this.errorCode = error;
 }
Exemplo n.º 3
0
 public static bool IsError(this SyslogRelayError value)
 {
     return(value != SyslogRelayError.Success);
 }