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

Function SetPyHFCError

isapi/src/PyFilterObjects.cpp:498–515  ·  view source on GitHub ↗

Setup an exception

Source from the content-addressed store, hash-verified

496
497// Setup an exception
498PyObject * SetPyHFCError(char *fnName, long err /*= 0*/)
499{
500 DWORD errorCode = err == 0 ? GetLastError() : err;
501 if (PyHFC_Error==NULL) {
502 PyObject *mod = PyImport_ImportModule("isapi");
503 if (mod)
504 PyHFC_Error = PyObject_GetAttrString(mod, "FilterError");
505 else
506 PyHFC_Error = PyExc_RuntimeError; // what's the alternative?
507 Py_XDECREF(mod);
508 }
509 PyObject *v = Py_BuildValue("(izs)", errorCode, NULL, fnName);
510 if (v != NULL) {
511 PyErr_SetObject(PyHFC_Error, v);
512 Py_DECREF(v);
513 }
514 return NULL;
515}
516
517/////////////////////////////////////////////////////////////////////////
518// PyURL_MAP object

Callers 8

WriteClientMethod · 0.85
AddResponseHeadersMethod · 0.85
GetServerVariableMethod · 0.85
SendResponseHeaderMethod · 0.85
DisableNotificationsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected