RigsOfRods / rigs-of-rods

Main development repository for Rigs of Rods soft-body physics simulator
https://www.rigsofrods.org
GNU General Public License v3.0
991 stars 175 forks source link

Always log CURL error string #3046

Closed ohlidalp closed 1 year ago

ohlidalp commented 1 year ago

At one moment the server had a certificate expired and I realized the game doesn't log anything useful in that situation. The HTTP response code remains '0' in those cases.

Seeing all the copy-pasted and mostly identical curl_easy*() calls, I should probably create a helper for it, but at the moment I just uniformly extended all the occurences with an error logging code.

CuriousMike56 commented 1 year ago

Good time to test this as the repo API is currently broken: 15:32:52: [RoR|Repository] Failed to retrieve repolist; Error: 'SSL peer certificate or SSH remote key was not OK'; HTTP status code: 0 Could the error be added to the UI? Right now it just says image

tritonas00 commented 1 year ago

Good time to test this as the repo API is currently broken: 15:32:52: [RoR|Repository] Failed to retrieve repolist; Error: 'SSL peer certificate or SSH remote key was not OK'; HTTP status code: 0 Could the error be added to the UI? Right now it just says image

I don't think the player needs to know if the cert expired or any verbose info in general, thats why i texted it like that.

Zentro commented 1 year ago

Good time to test this as the repo API is currently broken: 15:32:52: [RoR|Repository] Failed to retrieve repolist; Error: 'SSL peer certificate or SSH remote key was not OK'; HTTP status code: 0 Could the error be added to the UI? Right now it just says image

I don't think the player needs to know if the cert expired or any verbose info in general, thats why i texted it like that.

I think its useful information to include. Maybe just a server error code 4xx or 5xx, just something to indicate with a bit more information when someone posts a screenshot of an issue they have.

tritonas00 commented 1 year ago

Eitherway its just a matter of seconds to do it, all info is there.

ohlidalp commented 1 year ago

Thanks for the input. I think it should at least say "Server error, ask support" instead. Some detail below in darkened text can't hurt either

ohlidalp commented 1 year ago

It now displays CURL error under the general error, and if HTTP code is valid, it's also displayed. obrazek