feat: Update API versioning and parser handling for improved schedule updates and error management

This commit is contained in:
2026-10-19 23:29:35 +03:00
parent 85c5baa3e5
commit 68f9b95090
10 changed files with 32 additions and 18 deletions

View File

@@ -22,8 +22,11 @@ import java.util.concurrent.TimeUnit
*/
class ApiException(message: String, val offline: Boolean = false, val code: String? = null) : Exception(message)
/** Server codes after which trying again later can help. */
private val SOURCE_DOWN = setOf("source_unavailable", "source_timeout", "busy")
/**
* Server codes after which trying again later can help: the university is down or slow, the
* server is busy or did not answer in time, or this address sent too many requests.
*/
private val SOURCE_DOWN = setOf("source_unavailable", "source_timeout", "busy", "timeout", "too_many_requests")
val json = Json {
ignoreUnknownKeys = true