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

Use classed conditions as often as possible #5913

Open
MichaelChirico opened this issue Jan 15, 2024 · 3 comments
Open

Use classed conditions as often as possible #5913

MichaelChirico opened this issue Jan 15, 2024 · 3 comments
Labels
enhancement message Messages, warnings, errors

Comments

@MichaelChirico
Copy link
Member

#5912 is the latest example, but generally speaking it is a good idea to create some classed conditions.

The first step is to add support to stopf() and friends for making the resulting condition with extended class.

Thereafter we can work towards a taxonomy of condition classes.

@MichaelChirico
Copy link
Member Author

We'll also benefit from putting ... into the signature of test(), with entries referring to condition classes, then we can do test(n,x,y, custom_warning = ...). Implementation gets a bit messier from there but should be doable.

@jangorecki
Copy link
Member

I would also wait with this one till 1.17.0 at least, when first round of pending PRs will get resolved

@MichaelChirico
Copy link
Member Author

WDYT about merging #5914 now?

We don't need to use classed conditions everywhere yet, but could at least start for some common errors. Changing stopf() (etc) lines shouldn't cause too many conflicts with other PRs.

Even if not, with #5914 we can start writing custom classes for new functionality.

Most important is to pick a framework for errors, i.e. should all errors be classed like c("dt_${SPECIFIC_CLASS}", "dt_warn", "warning") (similarly for dt_error, dt_message, dt_startup_message)? Something else? We'll want to pick that first to avoid needing to change it when we scale up eventually.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement message Messages, warnings, errors
Projects
None yet
Development

No branches or pull requests

2 participants