private Exception WrapCOMException(Exception ex) { var returnEx = ex; if (ex is COMException comEx) { var lastApiError = Api.GetLastError(); returnEx = new EnhancedCOMException(lastApiError, comEx); } return(returnEx); }
private Exception WrapCOMException(Exception ex) { Exception returnEx = ex; COMException comEx = ex as COMException; if (comEx != null) { String lastApiError = Api.GetLastError(); returnEx = new EnhancedCOMException(comEx, lastApiError); } return(returnEx); }