mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
bpo-12382: Make OpenDatabase() raise better exception messages (GH-4528)
Previously, 'msilib.OpenDatabase()' function raised a cryptical exception message when it couldn't open or create an MSI file. For example: Traceback (most recent call last): File "<stdin>", line 1, in <module> _msi.MSIError: unknown error 6e
This commit is contained in:
parent
cdfe910e74
commit
4864a619dc
3 changed files with 20 additions and 0 deletions
|
@ -315,6 +315,12 @@ msierror(int status)
|
|||
case ERROR_INVALID_PARAMETER:
|
||||
PyErr_SetString(MSIError, "invalid parameter");
|
||||
return NULL;
|
||||
case ERROR_OPEN_FAILED:
|
||||
PyErr_SetString(MSIError, "open failed");
|
||||
return NULL;
|
||||
case ERROR_CREATE_FAILED:
|
||||
PyErr_SetString(MSIError, "create failed");
|
||||
return NULL;
|
||||
default:
|
||||
PyErr_Format(MSIError, "unknown error %x", status);
|
||||
return NULL;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue