fix: throw Exception not Error

Signed-off-by: Infi <infi@infi.sh>
This commit is contained in:
Infi 2024-06-25 21:20:37 +02:00
parent e84edc2122
commit 156ab8b16a
1 changed files with 5 additions and 5 deletions

View File

@ -18,7 +18,7 @@ suspend fun blockUser(userId: String) {
try {
val error = RevoltJson.decodeFromString(RevoltError.serializer(), response)
throw Error(error.type)
throw Exception(error.type)
} catch (e: SerializationException) {
// Not an error
}
@ -30,7 +30,7 @@ suspend fun unblockUser(userId: String) {
try {
val error = RevoltJson.decodeFromString(RevoltError.serializer(), response)
throw Error(error.type)
throw Exception(error.type)
} catch (e: SerializationException) {
// Not an error
}
@ -45,7 +45,7 @@ suspend fun friendUser(username: String) {
try {
val error = RevoltJson.decodeFromString(RevoltError.serializer(), body)
throw Error(error.type)
throw Exception(error.type)
} catch (e: SerializationException) {
// Not an error
}
@ -57,7 +57,7 @@ suspend fun acceptFriendRequest(userId: String) {
try {
val error = RevoltJson.decodeFromString(RevoltError.serializer(), response)
throw Error(error.type)
throw Exception(error.type)
} catch (e: SerializationException) {
// Not an error
}
@ -69,7 +69,7 @@ suspend fun unfriendUser(userId: String) {
try {
val error = RevoltJson.decodeFromString(RevoltError.serializer(), response)
throw Error(error.type)
throw Exception(error.type)
} catch (e: SerializationException) {
// Not an error
}