Skip to content

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

Merged
jashaik merged 1 commit into
mainfrom
CHEF-37251/lbaker
Nov 24, 2026
Merged

jashaik merged 1 commit into
mainfrom
CHEF-37251/lbaker

Conversation

@lbakerchef

@lbakerchef lbakerchef commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

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).

Test-only change: oc_httpc_tests now uses try/?assertExit instead of catch.

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>
@jashaik
jashaik merged commit 37665d1 into main Nov 24, 2026
1 of 2 checks passed
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.

3 participants