nickva commented on a change in pull request #3422:
URL: https://github.com/apache/couchdb/pull/3422#discussion_r593935003
##########
File path: src/couch/include/couch_db.hrl
##########
@@ -219,3 +219,29 @@
-type sec_props() :: [tuple()].
-type sec_obj() :: {sec_props()}.
+%% Erlang/OTP 21 deprecates and 23 removes get_stacktrace(), so
+%% we have to monkey around until we can drop support < 21.
+%% h/t https://github.com/erlang/otp/pull/1783#issuecomment-386190970
+
+%% use like so:
+% try function1(Arg1)
+% catch
+% ?STACKTRACE(exit, badarg, ErrorStackTrace)
+% % do stuff with ErrorStackTrace
+% % ...
+% end,
+
+% for features specific to Erlang/OTP version 20.x (and later versions)
+-ifdef(OTP_MAJOR_VSN_20).
+-else.
+-define(ERLANG_OTP_VERSION_21_FEATURES, true).
+-endif.
Review comment:
There might be an easier way to detect 20 vs 21+ we already do it in
fabric2
https://github.com/apache/couchdb/blob/00811b4a9c4df56defb7456431d44abb7c0baa79/src/fabric/src/fabric2_util.erl#L386-L387
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]