Skip to content

Commit 4d51bd6

Browse files
committed
Pass the stacktrace explicitly to IEx.Util functions
1 parent fc1945a commit 4d51bd6

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

lib/iex/lib/iex.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,11 +253,11 @@ defmodule IEx do
253253
config.binding(binding).scope(scope)
254254
rescue
255255
exception ->
256-
Util.print_exception(exception)
256+
Util.print_exception(exception, System.stacktrace)
257257
System.halt(1)
258258
catch
259259
kind, error ->
260-
Util.print_error(kind, error)
260+
Util.print_error(kind, error, System.stacktrace)
261261
System.halt(1)
262262
end
263263
end

lib/iex/lib/iex/server.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ defmodule IEx.Server do
2828
eval(code, line, counter, config)
2929
rescue
3030
exception ->
31-
Util.print_exception(exception)
31+
Util.print_exception(exception, System.stacktrace)
3232
config.cache('')
3333
catch
3434
kind, error ->
35-
Util.print_error(kind, error)
35+
Util.print_error(kind, error, System.stacktrace)
3636
config.cache('')
3737
end
3838

lib/iex/lib/iex/util.ex

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ defmodule IEx.Util do
44
# Private functions used by several IEx.* modules.
55

66
@doc false
7-
def print_exception(exception) do
8-
print_stacktrace System.stacktrace, fn ->
7+
def print_exception(exception, stacktrace) do
8+
print_stacktrace stacktrace, fn ->
99
"** (#{inspect exception.__record__(:name)}) #{exception.message}"
1010
end
1111
end
1212

1313
@doc false
14-
def print_error(kind, reason) do
15-
print_stacktrace System.stacktrace, fn ->
14+
def print_error(kind, reason, stacktrace) do
15+
print_stacktrace stacktrace, fn ->
1616
"** (#{kind}) #{inspect(reason)}"
1717
end
1818
end

0 commit comments

Comments
 (0)