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

CreateException() public static method

Creates an error message for a failed COM function call.
public static CreateException ( Exception e, string function ) : Exception
e System.Exception
function string
return System.Exception
        public static Exception CreateException(Exception e, string function)
        {
            return ServiceResultException.Create(
                StatusCodes.BadCommunicationError, 
                "Call to {0} failed. Error: {1}.", 
                function,
                ComUtils.GetSystemMessage(Marshal.GetHRForException(e), LOCALE_SYSTEM_DEFAULT));
        }