Implement priority filtering, rename package, preset URL, update remotes
Some checks failed
Build / Check (push) Has been cancelled

This commit is contained in:
kdusek
2025-11-28 20:06:33 +01:00
parent 547d9fd943
commit afcf93087c
42 changed files with 194 additions and 170 deletions

View File

@@ -0,0 +1,34 @@
package com.github.gotifycustom.api
import java.io.IOException
import retrofit2.Call
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 {
val response = call.execute()
if (response.isSuccessful) {
return response.body() ?: throw ApiException("null response", response)
} else {
throw ApiException(response)
}
} catch (e: IOException) {
throw ApiException(e)
}
}
}