@@ -144,28 +144,7 @@ void handleTokenFailure(Exception exception, bool displayNotification = false)
144144 if ( string . IsNullOrEmpty ( exception . Message ) )
145145 Logger . Error ( exception , $ "Failed to retrieve a score submission token.\n \n { whatWillHappen } ") ;
146146 else
147- {
148- switch ( exception . Message )
149- {
150- case @"missing token header" :
151- case @"invalid client hash" :
152- case @"invalid verification hash" :
153- Logger . Log ( $ "Please ensure that you are using the latest version of the official game releases.\n \n { whatWillHappen } ", level : LogLevel . Important ) ;
154- break ;
155-
156- case @"invalid or missing beatmap_hash" :
157- Logger . Log ( $ "This beatmap does not match the online version. Please update or redownload it.\n \n { whatWillHappen } ", level : LogLevel . Important ) ;
158- break ;
159-
160- case @"expired token" :
161- Logger . Log ( $ "Your system clock is set incorrectly. Please check your system time, date and timezone.\n \n { whatWillHappen } ", level : LogLevel . Important ) ;
162- break ;
163-
164- default :
165- Logger . Log ( $ "{ whatWillHappen } { exception . Message } ", level : LogLevel . Important ) ;
166- break ;
167- }
168- }
147+ Logger . Log ( $ "{ getUserFacingAPIError ( exception ) } \n \n { whatWillHappen } ", level : LogLevel . Important ) ;
169148 }
170149
171150 if ( shouldExit )
@@ -346,14 +325,36 @@ private Task submitScore(Score score)
346325
347326 request . Failure += e =>
348327 {
349- Logger . Error ( e , $ "Failed to submit score (token: { token . Value } ): { e . Message } ") ;
328+ Logger . Error ( e , $ "{ getUserFacingAPIError ( e ) } \n \n Score was not submitted (id: { token . Value } )") ;
350329 scoreSubmissionSource . SetResult ( false ) ;
351330 } ;
352331
353332 api . Queue ( request ) ;
354333 return scoreSubmissionSource . Task ;
355334 }
356335
336+ private static string getUserFacingAPIError ( Exception exception )
337+ {
338+ switch ( exception . Message )
339+ {
340+ case @"missing token header" :
341+ case @"invalid client hash" :
342+ case @"invalid verification hash" :
343+ case @"invalid token" :
344+ case @"outdated client" :
345+ return "Please ensure that you are using the latest version of the official game releases." ;
346+
347+ case @"invalid or missing beatmap_hash" :
348+ return "This beatmap does not match the online version. Please update or redownload it." ;
349+
350+ case @"expired token" :
351+ return "Your system clock is set incorrectly. Please check your system time, date and timezone." ;
352+
353+ default :
354+ return exception . Message ;
355+ }
356+ }
357+
357358 protected override ResultsScreen CreateResults ( ScoreInfo score ) => new SoloResultsScreen ( score )
358359 {
359360 AllowRetry = true ,
0 commit comments