Skip to content

Commit

Permalink
Report the top of the exception stack when there's no handler.
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt committed Dec 4, 2020
1 parent 63c8e47 commit aaab77e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/task.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,6 +558,11 @@ JL_DLLEXPORT void jl_switchto(jl_task_t **pt)

JL_DLLEXPORT JL_NORETURN void jl_no_exc_handler(jl_value_t *e)
{
// NULL exception objects are used when rethrowing. we don't have a handler to process
// the exception stack, so at least report the exception at the top of the stack.
if (!e)
e = jl_current_exception();

jl_printf((JL_STREAM*)STDERR_FILENO, "fatal: error thrown and no exception handler available.\n");
jl_static_show((JL_STREAM*)STDERR_FILENO, e);
jl_printf((JL_STREAM*)STDERR_FILENO, "\n");
Expand Down

0 comments on commit aaab77e

Please sign in to comment.