L1323 - Deprecated Catch Expression
Warning
foo() ->
catch bar().
%% ^^^^^ warning: 'catch ...' is deprecated
Explanation
Bare catch Expr expressions are deprecated. Use try ... catch ... end instead.
The old-style catch swallows all exceptions and returns {'EXIT', Reason} tuples
for errors and throws, which is error-prone. The try ... catch ... end syntax
provides explicit control over which exception classes to handle.
%% Instead of:
foo() -> catch bar().
%% Write:
foo() ->
try bar()
catch _:_ -> error
end.
This warning can be suppressed with -compile(nowarn_deprecated_catch).