Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abap Exception categories #335

Closed
niuniuch opened this issue Jul 19, 2023 · 3 comments
Closed

Abap Exception categories #335

niuniuch opened this issue Jul 19, 2023 · 3 comments
Labels
Adjustment Of Rule The issue or PR proposes an adjustment of a rule or set of rules clean-abap

Comments

@niuniuch
Copy link

It's 2023 and it's time to rewrite the section on exception categories (or remove it completely if you think it's not a settled subject) because in it's current state is causing harm.

Robert Martin said it already in 2001, and in 2023 it's clear as dailight.

  1. Use CX_NO_CHECK.
  2. In exceptional cases, when you want customers of your software to acknowledge exceptions that it might throw, consider wrapping a CX_CHECK exception around them in your public API layer (for example when developing a code library for sale).
  3. Never use CX_DYNAMIC_CHECK, as it's just an checked exception that can't be caught by it's name, it's always better to just use CX_NO_CHECK
@niuniuch niuniuch added Adjustment Of Rule The issue or PR proposes an adjustment of a rule or set of rules clean-abap labels Jul 19, 2023
@ConjuringCoffee
Copy link
Contributor

There's already a discussion about the same topic from 2020 that's unfortunately still open: #138

I suggest you either add a comment to that discussion or open a pull request to facilitate a faster discussion? 😉

@niuniuch
Copy link
Author

Thanks for pointing that out, I added a comment in #138.
I guess what is an exceptional case for me, might be the usual case for others. It all depends on what kind of code you're working on...

@bjoern-jueliger-sap
Copy link
Member

Closing this since the main discussion is in #138

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Adjustment Of Rule The issue or PR proposes an adjustment of a rule or set of rules clean-abap
Projects
None yet
Development

No branches or pull requests

3 participants