Skip to content

Commit a60e5de

Browse files
committed
Supporting pre 1.7
1 parent f869e21 commit a60e5de

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/bypass/plug.ex

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,13 @@ defmodule Bypass.Plug do
2222
conn
2323
catch
2424
class, reason ->
25-
put_result(pid, route, ref, {:exit, {class, reason, __STACKTRACE__}})
26-
:erlang.raise(class, reason, __STACKTRACE__)
25+
stacktrace = if Version.match?(System.version(), ">= 1.7.0") do
26+
__STACKTRACE__
27+
else
28+
System.stacktrace()
29+
end
30+
put_result(pid, route, ref, {:exit, {class, reason, stacktrace}})
31+
:erlang.raise(class, reason, stacktrace)
2732
end
2833

2934
{:error, error, route} ->

0 commit comments

Comments
 (0)