diff --git a/nise-backend/src/main/kotlin/com/nisemoe/nise/osu/OsuApi.kt b/nise-backend/src/main/kotlin/com/nisemoe/nise/osu/OsuApi.kt index 87f2244..ec40445 100644 --- a/nise-backend/src/main/kotlin/com/nisemoe/nise/osu/OsuApi.kt +++ b/nise-backend/src/main/kotlin/com/nisemoe/nise/osu/OsuApi.kt @@ -9,6 +9,7 @@ import org.slf4j.LoggerFactory import org.springframework.beans.factory.InitializingBean import org.springframework.beans.factory.annotation.Value import org.springframework.stereotype.Service +import java.io.IOException import java.net.URI import java.net.URLEncoder import java.net.http.HttpClient @@ -346,7 +347,12 @@ class OsuApi( val waitTimes = listOf(15L, 30L, 60L) for (waitTime in waitTimes) { - val response = httpClient.send(request, HttpResponse.BodyHandlers.ofString()) + val response = try { + httpClient.send(request, HttpResponse.BodyHandlers.ofString()) + } catch (ex: IOException) { + // Some transport level exception might be thrown, continue with the retry backoff and see if it fixes itself + continue + } this.logger.debug("Request: {}", request.uri()) this.logger.debug("Result: {}", response.statusCode())