Skip to content

Commit

Permalink
Unify way of printing exceptions from within fibers (crystal-lang#6594)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sija authored and Ezra Stevens committed Oct 1, 2018
1 parent 0dd5ea6 commit 26adca4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/fiber.cr
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,11 @@ class Fiber
@proc.call
rescue ex
if name = @name
STDERR.puts "Unhandled exception in spawn(name: #{name}):"
STDERR.print "Unhandled exception in spawn(name: #{name}): "
else
STDERR.puts "Unhandled exception in spawn:"
STDERR.print "Unhandled exception in spawn: "
end
ex.inspect_with_backtrace STDERR
ex.inspect_with_backtrace(STDERR)
STDERR.flush
ensure
@@stack_pool << @stack
Expand Down
1 change: 1 addition & 0 deletions src/kernel.cr
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,7 @@ module AtExitHandlers

STDERR.print "Unhandled exception: "
ex.inspect_with_backtrace(STDERR)
STDERR.flush
end

status
Expand Down

0 comments on commit 26adca4

Please sign in to comment.