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 cli errors #925

Open
EmilHvitfeldt opened this issue Jul 25, 2024 · 0 comments
Open

Use cli errors #925

EmilHvitfeldt opened this issue Jul 25, 2024 · 0 comments
Labels
feature a feature request or enhancement

Comments

@EmilHvitfeldt
Copy link
Member

Ref: tidymodels/rsample#457

Most or all errors thrown in this package are made via rlang::abort(). We are transitioning to cli::cli_abort() to make use of the richer styling options for errors via cli (which calls rlang under the hood).

These are the following "counts":

$ package    <chr> "tune"
$ cli_abort  <int> 33
$ cli_warn   <int> 14
$ cli_inform <int> 2
$ abort      <int> 116
$ warn       <int> 13
$ inform     <int> 0
$ stop       <int> 0
$ warning    <int> 5
$ message    <int> 10

I have a feeling we won't be able to convert all message() uses as they are more integral to how the logging works. Which is fine.

This issue is deliberitely not a tidy-dev-day issue because of the way we use exit handlers to catch and rethrow most errors.

@EmilHvitfeldt EmilHvitfeldt added the feature a feature request or enhancement label Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature a feature request or enhancement
Projects
None yet
Development

No branches or pull requests

1 participant