Skip to content

Replace deprecated catch operator with try...catch#164

Merged
bjosv merged 3 commits intoEricsson:mainfrom
bjosv:otp-29
Apr 22, 2026
Merged

Replace deprecated catch operator with try...catch#164
bjosv merged 3 commits intoEricsson:mainfrom
bjosv:otp-29

Conversation

@bjosv
Copy link
Copy Markdown
Collaborator

@bjosv bjosv commented Mar 23, 2026

The catch operator is deprecated and OTP 29 will emit compiler warnings for its use.
Replaced catch with try...catch and start building with OTP 29.0-rc2 in CI.

===> Compiling ered
     ┌─ src/ered_connection.erl:
     │
 127 │                case catch Transport:connect(Addr, Port, [{active, false}, binary] ++ Options, Timeout) of
     │                     ╰── Warning: 'catch ...' is deprecated; please use 'try ... catch ... end' instead.
Compile directive 'nowarn_deprecated_catch' can be used to suppress
warnings in selected modules.

Reference:
https://www.erlang.org/news/185#compiler-warnings

@zuiderkwast
Copy link
Copy Markdown
Collaborator

Good catch(!) but we will probably delete ered_connection. It's deleted in the feature branch single-process-client. If we merge this PR now, it will give us conflicts.

Do you want to open this PR against the feature branch instead? Otherwise wait until it's merged.

@bjosv
Copy link
Copy Markdown
Collaborator Author

bjosv commented Mar 25, 2026

Do you want to open this PR against the feature branch instead? Otherwise wait until it's merged.

I can wait until the feature branch is merged, then I can replace 29.0-rc2 with 29.0.1 depending on the timeframe.

bjosv added 2 commits April 20, 2026 17:21
Signed-off-by: Björn Svensson <bjorn.a.svensson@est.tech>
The catch operator is deprecated and OTP 29 will emit compiler
warnings for its use.
https://www.erlang.org/news/185#compiler-warnings

Signed-off-by: Björn Svensson <bjorn.a.svensson@est.tech>
Comment thread test/ered_cluster_SUITE.erl Outdated
Signed-off-by: User <user@example.com>
@bjosv bjosv merged commit 71e0474 into Ericsson:main Apr 22, 2026
12 checks passed
@bjosv bjosv deleted the otp-29 branch April 22, 2026 07:18
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