Skip to content

Commit

Permalink
Handle exception in _store_error()
Browse files Browse the repository at this point in the history
  • Loading branch information
mwilliamson committed Aug 14, 2024
1 parent ae09db3 commit 0ce4b21
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion jq.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 0ce4b21

Please sign in to comment.