[R-package] raise informative errors directly when Booster creation fails #5014
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Based on #5007 (comment), I started working on a PR to remove
lgb.check.obj()
from the R package.While doing that, I found that the
try()
inBooster$initialize()
made it difficult to catch specific error messages in tests. I think that thattry()
is left over from prior to the work for #3016. Now that errors from the C++ side are raised directly as R errors, I no longer think it's necessary.This PR doesn't change anything about when the package raises an error, just the content of the error message.
Note for Reviewers
I recommend using "Hide whitespace" when reviewing this diff.