diff options
| author | Michael Williamson <mike@zwobble.org> | 2025-03-02 10:58:39 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2025-03-02 10:58:39 +0000 |
| commit | d671908e7f36fea2d128fc32779ff2d77cdb890b (patch) | |
| tree | e9d93dc61d9cffff3903733982119a490c2b02ab /jq.pyx | |
| parent | 37c6f8a5cbb2cfc4cd9726ebc82c1ced7c7b2604 (diff) | |
Convert non-string errors into JSON text
Diffstat (limited to 'jq.pyx')
| -rw-r--r-- | jq.pyx | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -183,13 +183,15 @@ cdef void _store_error(void* store_ptr, jv error) noexcept: cdef unicode _jq_error_to_py_string(jv error) noexcept: + error = jv_copy(error) + if jv_get_kind(error) == JV_KIND_STRING: try: return jv_string_to_py_string(error) except: return u"Internal error" else: - return u"(not a string)" + return json.dumps(_jv_to_python(error)) cdef class _ErrorStore(object): |
