diff --git a/app/src/main/java/dev/kaizen/app/net/KaizenApi.kt b/app/src/main/java/dev/kaizen/app/net/KaizenApi.kt index b70894e..1aa466f 100644 --- a/app/src/main/java/dev/kaizen/app/net/KaizenApi.kt +++ b/app/src/main/java/dev/kaizen/app/net/KaizenApi.kt @@ -34,7 +34,7 @@ import java.util.concurrent.TimeUnit @Serializable data class KaizenModel( val id: String, - val name: String, + val name: String? = null, val provider: String? = null, ) @@ -137,7 +137,7 @@ object KaizenApi { if (!resp.isSuccessful) return@use null json.decodeFromString(resp.body!!.string()).defaultModel } - } catch (e: IOException) { + } catch (e: Exception) { null } } @@ -154,7 +154,7 @@ object KaizenApi { if (!resp.isSuccessful) return@use emptyList() json.decodeFromString(resp.body!!.string()).models } - } catch (e: IOException) { + } catch (e: Exception) { emptyList() } } @@ -171,7 +171,7 @@ object KaizenApi { if (!resp.isSuccessful) return@use emptyList() json.decodeFromString(resp.body!!.string()).conversations } - } catch (e: IOException) { + } catch (e: Exception) { emptyList() } } @@ -190,7 +190,7 @@ object KaizenApi { if (!resp.isSuccessful) return@use null json.decodeFromString(resp.body!!.string()).id } - } catch (e: IOException) { + } catch (e: Exception) { null } } @@ -207,7 +207,7 @@ object KaizenApi { if (!resp.isSuccessful) return@use emptyList() json.decodeFromString(resp.body!!.string()).messages } - } catch (e: IOException) { + } catch (e: Exception) { emptyList() } } @@ -223,7 +223,7 @@ object KaizenApi { .build() try { client.newCall(req).execute().use { resp -> resp.isSuccessful } - } catch (e: IOException) { + } catch (e: Exception) { false } } @@ -238,7 +238,7 @@ object KaizenApi { .build() try { client.newCall(req).execute().use { } - } catch (e: IOException) { + } catch (e: Exception) { // best-effort: a missing title is cosmetic } }