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));
}