Skip to content

Commit

Permalink
Add traceback to exception message and more data to failed export mes…
Browse files Browse the repository at this point in the history
…sage
  • Loading branch information
813gan committed Sep 18, 2024
1 parent 0bf86b1 commit ef29220
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions emacspy.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ cdef class EmacsValue:
return self.as_list()
elif my_type == "hash-table":
return self.as_dict()
raise ValueError("Unable to export emacs value")
raise ValueError(f"Unable to export emacs value of type '{my_type} ({str(self)})'")

def __str__(self):
return _F().prin1_to_string(self).str()
Expand Down Expand Up @@ -354,7 +354,7 @@ cdef emacs_value call_python_object(emacs_env *env, ptrdiff_t nargs, emacs_value
c_result = unwrap(result)
except BaseException as exc:
c_result = string_ptr("error")
msg = type(exc).__name__ + ': ' + str(exc)
msg = type(exc).__name__ + ': ' + str(exc) + "\n" + traceback.format_exc()
env.non_local_exit_signal(env, sym_ptr('python-exception'), string_ptr(msg))

current_env = prev_env
Expand Down

0 comments on commit ef29220

Please sign in to comment.