EvoEsports / EvoSC-sharp

Next generation server controller for Trackmania written in C# using modern .NET
https://evosc.io
GNU General Public License v3.0
20 stars 13 forks source link

WRM: Handle Flurl http exceptions #309

Closed flaeri closed 1 month ago

flaeri commented 2 months ago

Instead of throwing, we log an error message, and let it continue. This will let it use the local author record, and not crash.

Update comment to inform about the possibility of it returning without completing in the event of API errors.

Fixed whitespace and formatting

Fixes #294

Tested locally on my machine with a custom made map that was not uploaded. It didnt crash/throw, and the AT was loaded. Tested a known good online map, and it correctly loaded the WR.

Bad map, log output:

30.09.2024 08:56:47.5159] fail: EvoSC.Modules.Official.WorldRecordModule.Services.WorldRecordService[0] Error fetching data from trackmania.io API. Status code: 500 Flurl.Http.FlurlHttpException: 

Call failed with status code 500 (Internal Server Error):GET https://trackmania.io/api/leaderboard/map/fbZzfRsYokp1Zpp0GoXokjYLuuj    

at Flurl.Http..... long stack trace ...

[30.09.2024 08:57:08.3710] dbug: EvoSC.Modules.Official.WorldRecordModule.Services.WorldRecordService[0] Couldn't load World Record, using Author Time instead.
flaeri commented 1 month ago

That ci check wasn't there last time I checked 😞

Can't say I see anything actionable. Please let me know if there is anything you would like me to fix/change

snixtho commented 1 month ago

That ci check wasn't there last time I checked 😞

Can't say I see anything actionable. Please let me know if there is anything you would like me to fix/change

Qodana? You can ignore this as its just something we're testing out atm.

sonarcloud[bot] commented 1 month ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarCloud