Skip to content
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

WRM: Handle Flurl http exceptions #309

Merged
merged 1 commit into from
Oct 8, 2024

Conversation

flaeri
Copy link
Contributor

@flaeri flaeri commented Sep 30, 2024

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
Copy link
Contributor Author

flaeri commented Oct 4, 2024

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
Copy link
Member

snixtho commented Oct 5, 2024

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.

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 possiblity of it returning without
completing in the event of API errors.

Fixed whitespace and formatting
Copy link

sonarcloud bot commented Oct 5, 2024

@araszka araszka merged commit cfee067 into EvoEsports:master Oct 8, 2024
2 of 3 checks passed
@flaeri flaeri deleted the bugfix-WRM-crash branch October 8, 2024 16:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] WorldRecordModule crashes on startup if map is not uploaded to NadeoServices
3 participants