elixir-koans icon indicating copy to clipboard operation
elixir-koans copied to clipboard

Remove stacktrace warning

Open felipesere opened this issue 6 years ago • 3 comments

Using STACKTRACE is not really an option due to it requiring a try/catch block, which we'd have to possibly add to every koan.

Side-step the issue by calling into Erlang

felipesere avatar Oct 12 '19 10:10 felipesere

FWIW, this is not going to work on recent OTP versions. Erlang/OTP 23 always returns an empty list for stacktrace and the next version will fully remove the function.

josevalim avatar Jun 17 '20 23:06 josevalim

@josevalim @iamvery My current thinking is that we can avoid going through the stacktrace to find file & line if we just capture them in the generated koan function using __ENV__.file and __ENV__.line in the first place.

I'll try a PR this evening and update this :)

felipesere avatar Jun 18 '20 07:06 felipesere

I'm quite happy with this new approach. If an error happens within a Koan, I grab __ENV__.line and __ENV__.file and report it back up as part of the error. That way, there is no need to walk the stacktrace anymore!

felipesere avatar Jun 19 '20 07:06 felipesere