Created
August 23, 2017 21:04
-
-
Save fenollp/a362f1dfa94f2033700ba20d092c8588 to your computer and use it in GitHub Desktop.
Test printing ST with -Wall & OTP20
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%% Copyright © 2017 Pierre Fenoll ‹pierrefenoll@gmail.com› | |
%% See LICENSE for licensing information. | |
%% -*- coding: utf-8 -*- | |
%% @module Test printing ST with -Wall & OTP20 | |
-module(pp_stack_inside_try_catch). | |
-export([m/1]). | |
%% API | |
m(Arg) -> | |
try Arg + 1 of | |
1 -> | |
catch throw(lol), | |
print_ST(); %%non-empty ST | |
_ -> | |
%% empty ST | |
print_ST() | |
catch _:_ -> | |
%% non-empty ST | |
print_ST() | |
end. | |
%% Internals | |
print_ST() -> | |
ST = erlang:get_stacktrace(), | |
io:format(">>> ST ~p\n", [ST]). | |
%% End of Module. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment