-
Notifications
You must be signed in to change notification settings - Fork 12.9k
Catch exceptions correctly in server.cpp #7642
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
Conversation
Catched exceptions in server load.
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.
I like that you removed the redundant else statement good catch.
Anyhow looks good to me. Let's wait for the check to pass and then merge.
Why did one check fail? |
LOL |
removed an emty line to please a tupid bot.
why is this still not accepted? |
After a second look on the PR, I don't think it's necessary to add this try..catch block. If there is a problem loading the model, In addition, it would be nice to have a concrete example of a model failed to load (i.e. example of model / command). It makes no sense to fix a problem that never occurs. |
} catch (const std::exception &e) { | ||
// Catch known standard exceptions | ||
LOG_ERROR("unable to load model", {{"error", e.what()}}); | ||
exit(1); |
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.
You forgot to change this.
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.
ok.. I give up... 3 days and still nothing for a simple modification..
also: on windows, the program crashes for every stupid error like putting a non existant model filename.
that just plain wrong.
all exceptions should be caught. mine was only an example.
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.
try { | ||
// Attempt to load the model | ||
if (!ctx_server.load_model(params)) { | ||
LOG_ERROR("unable to load model", {{"error", "Load model failed"}}); |
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.
Here is why it makes no sense to me: we already catch the unable to load model
. Why do we need another try..catch to do that?
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.
Everyone is a volunteer here. We do what we can. My understanding is that you thought Anyway we appreciate the fact that you made an effort and will note down your recommendation separately as you have deleted this patch branch, to ensure you will be credited when we get around to it. |
Catched exceptions in server load.