MCPcopy Create free account
hub / github.com/mhammond/pywin32 / PyCom_SetCOMErrorFromPyException

Function PyCom_SetCOMErrorFromPyException

com/win32com/src/ErrorUtils.cpp:343–365  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

341}
342
343PYCOM_EXPORT HRESULT PyCom_SetCOMErrorFromPyException(REFIID riid /* = IID_NULL */)
344{
345 if (!PyErr_Occurred())
346 // No error occurred
347 return S_OK;
348
349 // These errors are generally 'unexpected' (ie, errors converting args on
350 // the way into a gateway method. If not explicitly raised by the user,
351 // log it.
352 PyCom_LoggerNonServerException(NULL, "Unexpected gateway error");
353
354 EXCEPINFO einfo;
355 PyCom_ExcepInfoFromPyException(&einfo);
356
357 // force this to a failure just in case we couldn't extract a proper
358 // error value
359 if ( einfo.scode == S_OK )
360 einfo.scode = E_FAIL;
361
362 PyCom_SetCOMErrorFromExcepInfo(&einfo, riid);
363 PyCom_CleanupExcepInfo(&einfo);
364 return einfo.scode;
365}
366
367PYCOM_EXPORT HRESULT PyCom_SetAndLogCOMErrorFromPyException(const char *methodName, REFIID riid /* = IID_NULL */)
368{

Callers 15

univgw_dispatchFunction · 0.85
CreateRegisteredTearOffFunction · 0.85
getids_finishFunction · 0.85
GetDispIDMethod · 0.85
DeleteMemberByNameMethod · 0.85
DeleteMemberByDispIDMethod · 0.85
GetMemberPropertiesMethod · 0.85
GetMemberNameMethod · 0.85
GetNextDispIDMethod · 0.85

Tested by

no test coverage detected