Opc.Ua.Com.ComUtils.TraceComError C# (CSharp) Method

TraceComError() public static method

Reports an unexpected exception during a COM operation.
public static TraceComError ( Exception e, string format ) : void
e System.Exception
format string
return void
        public static void TraceComError(Exception e, string format, params object[] args)
        {
            string message = Utils.Format(format, args);

            int code = Marshal.GetHRForException(e);
            
            string error = ResultIds.GetBrowseName(code);

            if (error == null)
            {
                Utils.Trace(e, message);
                return;
            }

            Utils.Trace(e, "{0}: {1}", error, message);
        }
        #endregion