MCPcopy Create free account
hub / github.com/ashvardanian/StringZilla / wrap_current_exception

Function wrap_current_exception

python/stringzilla.c:907–912  ·  view source on GitHub ↗

* @brief Helper function to wrap the current exception with a custom prefix message. * A example is augmenting the argument parsing error with the name of the variable * that didn't pass the validation. */

Source from the content-addressed store, hash-verified

905 * that didn't pass the validation.
906 */
907void wrap_current_exception(sz_cptr_t comment) {
908 // ? Prior to Python 3.12 we need to fetch and restore the exception state using
909 // ? `PyErr_Fetch` and `PyErr_Restore` to avoid overwriting the current exception.
910 // ? After Python 3.12 we can use `PyErr_GetRaisedException` and `PyErr_SetRaisedException`.
911 sz_unused_(comment);
912}
913
914typedef void (*get_string_at_offset_t)(Strs *, Py_ssize_t, Py_ssize_t, PyObject **, sz_cptr_t *, sz_size_t *);
915

Callers 15

Str_initFunction · 0.85
Str_like_hashFunction · 0.85
Str_like_fill_randomFunction · 0.85
module_randomFunction · 0.85
Str_like_bytesumFunction · 0.85
Str_like_sha256Function · 0.85
hmac_sha256Function · 0.85
Str_like_equalFunction · 0.85
Str_inFunction · 0.85
Strs_inFunction · 0.85
Strs_richcompareFunction · 0.85
Str_like_decodeFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…