diff options
| author | Michael Williamson <mike@zwobble.org> | 2024-08-14 18:40:39 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2024-08-14 18:40:39 +0100 |
| commit | 0ce4b21aab50c1d173f2f41797dbfdeabba71a3d (patch) | |
| tree | 7fe17c372f71c722776c8a6589baa217efc8ca52 /jq.pyx | |
| parent | ae09db302c87c48f8fa4e048c52bd0730d0a1afd (diff) | |
Handle exception in _store_error()
Diffstat (limited to 'jq.pyx')
| -rw-r--r-- | jq.pyx | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -177,7 +177,12 @@ cdef void _store_error(void* store_ptr, jv error) noexcept: # TODO: handle errors not of JV_KIND_STRING cdef _ErrorStore store = <_ErrorStore>store_ptr if jv_get_kind(error) == JV_KIND_STRING: - store.store_error(jv_string_to_py_string(error)) + try: + error_string = jv_string_to_py_string(error) + except: + error_string = "Internal error" + + store.store_error(error_string) jv_free(error) |
