Skip to content

Commit b4f13dc

Browse files
committed
Moving the elixir version check into compilation time
1 parent a60e5de commit b4f13dc

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/bypass/plug.ex

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ defmodule Bypass.Plug do
2222
conn
2323
catch
2424
class, reason ->
25-
stacktrace = if Version.match?(System.version(), ">= 1.7.0") do
26-
__STACKTRACE__
27-
else
28-
System.stacktrace()
25+
stacktrace = unquote do
26+
if Version.match?(System.version(), ">= 1.7.0") do
27+
quote do: __STACKTRACE__
28+
else
29+
quote do: System.stacktrace()
30+
end
2931
end
3032
put_result(pid, route, ref, {:exit, {class, reason, stacktrace}})
3133
:erlang.raise(class, reason, stacktrace)

0 commit comments

Comments
 (0)