mirror of
https://github.com/livebook-dev/livebook.git
synced 2025-09-06 21:14:26 +08:00
Include full stacktrace for unexpected exceptions (#781)
* Include full stacktrace for unexpected exceptions * Update lib/livebook_cli.ex Co-authored-by: Jonatan Kłosko <jonatanklosko@gmail.com>
This commit is contained in:
parent
33b220873f
commit
c66582f8bb
1 changed files with 9 additions and 2 deletions
|
@ -53,9 +53,16 @@ defmodule LivebookCLI do
|
|||
try do
|
||||
task.call(args)
|
||||
rescue
|
||||
error in OptionParser.ParseError ->
|
||||
IO.ANSI.format([
|
||||
:red,
|
||||
Exception.message(error),
|
||||
"\n\nFor more information try --help"
|
||||
])
|
||||
|> IO.puts()
|
||||
|
||||
error ->
|
||||
IO.ANSI.format([:red, Exception.message(error), "\n"]) |> IO.puts()
|
||||
IO.write(task.usage())
|
||||
IO.ANSI.format([:red, Exception.format(:error, error, __STACKTRACE__), "\n"]) |> IO.puts()
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue