-
Notifications
You must be signed in to change notification settings - Fork 66
[ML] Downgrade log severity for a batch of recoverable errors #2889
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
base: main
Are you sure you want to change the base?
[ML] Downgrade log severity for a batch of recoverable errors #2889
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
Closes #2888 |
edsavage
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just the one comment
valeriy42
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great start @darius-vil ! 🚀 I left a few improvement suggestions.
Can you also please update the reporting of bad category error in lib/maths/common/CXMeansOnline1d.cc:468 as described in the issue #2888?
You can use a numerical error check along the lines of:
namespace {
bool isNumericalError(const std::exception& e) {
// Check exception type
if (dynamic_cast<const std::domain_error*>(&e) ||
dynamic_cast<const std::overflow_error*>(&e) ||
dynamic_cast<const std::underflow_error*>(&e)) {
return true;
}
// Check message content as fallback
std::string msg = e.what();
return msg.find("boost::math") != std::string::npos ||
msg.find("Scale parameter") != std::string::npos ||
msg.find("must be > 0") != std::string::npos ||
msg.find("-nan") != std::string::npos ||
msg.find("-inf") != std::string::npos;
}
}
valeriy42
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Great work! 👍
Fixes #2888