Skip to content

[refactor] add error message to all new Error() calls#15609

Merged
normanmaurer merged 1 commit intonetty:4.2from
asolntsev:refactor/add-error-message
Sep 4, 2025
Merged

[refactor] add error message to all new Error() calls#15609
normanmaurer merged 1 commit intonetty:4.2from
asolntsev:refactor/add-error-message

Conversation

@asolntsev
Copy link
Copy Markdown
Contributor

It's treated a bad practices to create exceptions without error message.

Motivation:

Even if it seems that the error can never happen, it still can - for example, when someone adds an enum value and forgets to update all switches.

Modification:

Replaced all calls of new Error() by new Error("Unexpected something: " + value).

Comment thread handler-proxy/src/main/java/io/netty/handler/proxy/Socks5ProxyHandler.java Outdated
@asolntsev asolntsev force-pushed the refactor/add-error-message branch from eeecf34 to 5ff746f Compare September 3, 2025 08:19
@asolntsev asolntsev requested a review from chrisvest September 3, 2025 18:02
@chrisvest
Copy link
Copy Markdown
Member

The two timed-out builds spent multiple hours running the codec-compression tests, which normally takes less than a minute.

Can you try rebasing, and running those tests locally to see if there's anything weird going on?

It's treated a bad practices to create exceptions without error message.
Even if it seems that the error can never happen, it still can - for example, when someone adds an enum value and forgets to update all switches.
@asolntsev asolntsev force-pushed the refactor/add-error-message branch from 5ff746f to f1c0822 Compare September 3, 2025 19:07
@asolntsev
Copy link
Copy Markdown
Contributor Author

Can you try rebasing,

Sure. I've rebased on 4.2

@chrisvest
Copy link
Copy Markdown
Member

I found out why those builds are slow: #15616

It's nothing to do with the changes in this PR.

@normanmaurer normanmaurer merged commit 7134f60 into netty:4.2 Sep 4, 2025
16 of 18 checks passed
@normanmaurer
Copy link
Copy Markdown
Member

@asolntsev thanks

@normanmaurer normanmaurer added this to the 4.2.6.Final milestone Sep 4, 2025
@asolntsev asolntsev deleted the refactor/add-error-message branch September 4, 2025 12:44
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