summaryrefslogtreecommitdiff
path: root/jq.pyx
diff options
context:
space:
mode:
authorMichael Williamson <mike@zwobble.org>2024-08-14 18:40:39 +0100
committerMichael Williamson <mike@zwobble.org>2024-08-14 18:40:39 +0100
commit0ce4b21aab50c1d173f2f41797dbfdeabba71a3d (patch)
tree7fe17c372f71c722776c8a6589baa217efc8ca52 /jq.pyx
parentae09db302c87c48f8fa4e048c52bd0730d0a1afd (diff)
Handle exception in _store_error()
Diffstat (limited to 'jq.pyx')
-rw-r--r--jq.pyx7
1 files changed, 6 insertions, 1 deletions
diff --git a/jq.pyx b/jq.pyx
index 5ee38f4..d8ebffa 100644
--- a/jq.pyx
+++ b/jq.pyx
@@ -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)