stacktrace_compat

get_stacktrace() compatibility in OTP 21+


Keywords
erlang, stacktrace
License
Other

Documentation

stacktrace_compat

Given the upcoming release of Erlang/OTP 24, stacktrace_compat is no longer maintained as of April 2nd, 2021.

⚠️ You should discontinue any use of this library unless you strictly need to maintain compatibility with Erlang/OTP versions older than 21 (released back in 2018.)

How do I do that?

Start by:

  1. removing, from rebar.config:
    • under erl_opts, {parse_transform, stacktrace_transform}
    • under deps, stacktrace_compat
  2. removing, from your_app.app.src:
    • under applications, stacktrace_compat (it needn't be there, but it may be)

..and then:

  1. search your code for calls to erlang:get_stacktrace();
  2. replace them with the current syntax for capturing stacktraces.
History

stacktrace_compat defined a parse transform (stacktrace_transform) which, when applied to modules on OTP 21+, replaced calls to erlang:get_stacktrace() with instances of the stacktrace binding that was to be captured on the closest catch pattern up the abstract syntax tree (within the same named function.)

If no binding had been defined, a generated name would have been used that was likely to be conflict free.

If no catch pattern was found, no replacement was made.


Generated by EDoc