Ejemplo n.º 1
0
        public static COMException CreateException(this TraceType traceType, NativeTypes.FABRIC_ERROR_CODE error, string format, params object[] args)
        {
            string message   = string.Format(CultureInfo.InvariantCulture, format, args);
            var    exception = new COMException(message, (int)error);

            traceSource.WriteExceptionAsWarningWithId(traceType.Name, traceType.Id, exception, string.Empty);

            return(exception);
        }
Ejemplo n.º 2
0
 public void WriteExceptionAsWarning(TraceType traceType, Exception ex, string format, params object[] args)
 {
     if (!string.IsNullOrEmpty(this.TraceId))
     {
         TraceSource.WriteExceptionAsWarningWithId(traceType.Name, this.TraceId, ex, format, args);
     }
     else
     {
         TraceSource.WriteExceptionAsWarning(traceType.Name, ex, format, args);
     }
 }