# Stacktrace\_compat: get\_stacktrace() compatibility on OTP 21

**URL:** <https://forum.elixirforum.com/t/stacktrace-compat-get-stacktrace-compatibility-on-otp-21/14830>\
**Category:** Announcing\
**Tags:** library, stacktrace\_compat, stacktrace\
**Created:** [June 23, 2018, 5:12pm UTC](https://forum.elixirforum.com/t/stacktrace-compat-get-stacktrace-compatibility-on-otp-21/14830 "2018-06-23T17:12:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![g-andrade](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/g-andrade/32/24455_2.png) [@g-andrade](https://forum.elixirforum.com/u/g-andrade)\
**Post date:** [June 23, 2018, 5:12pm UTC](https://forum.elixirforum.com/t/stacktrace-compat-get-stacktrace-compatibility-on-otp-21/14830/1 "2018-06-23T17:12:55Z")

</div>

Hi forum,

I’m pleased to announce the release of [stacktrace\_compat](https://github.com/g-andrade/stacktrace_compat/blob/master/README.md) 1.0, a workaround for the deprecation of `erlang:get_stacktrace()` in Erlang/OTP 21.

It intends on smoothing near-future maintenance of projects that are to support both pre- and post-deprecation code by avoiding code duplication or ungainly macros.

It replaces calls to `:get_stacktrace()` with references to bindings (whether explicit or implicit) that capture the stacktrace using the new syntax.

- [Overview](https://github.com/g-andrade/stacktrace_compat/blob/master/README.md)
- [Hex.pm package](https://hex.pm/packages/stacktrace_compat)

---

<div class="post-metadata">

**Author:** ![g-andrade](https://forum.elixirforum.com/user_avatar/forum.elixirforum.com/g-andrade/32/24455_2.png) [@g-andrade](https://forum.elixirforum.com/u/g-andrade)\
**Post date:** [July 11, 2018, 10:05pm UTC](https://forum.elixirforum.com/t/stacktrace-compat-get-stacktrace-compatibility-on-otp-21/14830/2 "2018-07-11T22:05:09Z")

</div>

[stacktrace\_compat 1.0.1](https://hex.pm/packages/stacktrace_compat/1.0.1) released.

Fixed:

- unsafe use of stacktrace variables exported from previous try-catch blocks

Full change log [here](https://github.com/g-andrade/stacktrace_compat/blob/1.0.1/CHANGELOG.md).
