Skip to content

CHEF-37251: Replace deprecated old-style catch expressions (OTP 29) - #6

Open
lbakerchef wants to merge 1 commit into
masterfrom
CHEF-37251/lbaker
Open

lbakerchef wants to merge 1 commit into
masterfrom
CHEF-37251/lbaker

Conversation

@lbakerchef

@lbakerchef lbakerchef commented Nov 12, 2026 •

Copy link
Copy Markdown

Description

OTP 29 deprecates the old-style catch Expr construct. This replaces every use in this repo with an equivalent try ... catch, preserving the original behaviour (where the caught value is used, the same value/{'EXIT', ...} term is produced; where the result was discarded, all exceptions are still swallowed).

Part of the Chef Infra Server Erlang/OTP 29.1.2 upgrade (chef/chef-server#4252).

Related Issue

CHEF-37251

AI assistance

This work was completed with assistance from GitHub Copilot.

Evidence

$ /opt/opscode/embedded/bin/erl -version
Erlang (SMP,ASYNC_THREADS) (BEAM) emulator version 17.1.1

$ cat /opt/opscode/embedded/lib/erlang/releases/29/OTP_VERSION
29.1.2

OTP 29 deprecates the old-style `catch Expr` construct. Rewrite each
use as an equivalent try/catch that preserves the original behaviour.

Signed-off-by: Lincoln Baker <lbaker@progress.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Comment thread src/pooler.erl
try erlang:apply(Mod, Fun, NewArgs) of
_Result ->
ok
catch

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we call
terminate_pid(PoolName, Pid, ?DEFAULT_STOP_MFA); in all cases of catch like :,
when it is throw:_ we are not calling terminate_pid(PoolName, Pid, ?DEFAULT_STOP_MFA);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants