Fix crash on delete (app|message|client)

This commit is contained in:
Jannis Mattheis
2023-01-23 10:17:04 +01:00
parent 284428c7ad
commit 879248bf4f
8 changed files with 39 additions and 29 deletions

View File

@@ -4,6 +4,19 @@ import retrofit2.Call
import java.io.IOException
internal object Api {
@Throws(ApiException::class)
fun execute(call: Call<Void>) {
try {
val response = call.execute()
if (!response.isSuccessful) {
throw ApiException(response)
}
} catch (e: IOException) {
throw ApiException(e)
}
}
@Throws(ApiException::class)
fun <T> execute(call: Call<T>): T {
try {