Skip to content

Commit

Permalink
Merge pull request #38679 from JuliaLang/tb/excstack_without_handler
Browse files Browse the repository at this point in the history
Report the top of the exception stack when there's no handler.

-------

Backport #38679 into release-1.5
  • Loading branch information
maleadt authored and NHDaly committed Jan 21, 2021
1 parent ae8c3a0 commit 4f70156
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 @@ -462,6 +462,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_STDERR, "fatal: error thrown and no exception handler available.\n");
jl_static_show(JL_STDERR, e);
jl_printf(JL_STDERR, "\n");
Expand Down

0 comments on commit 4f70156

Please sign in to comment.