Skip to content

Commit 5292272

Browse files
committed
fix the response code range check
1 parent c2e0147 commit 5292272

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

android/app/src/main/java/com/httpsms/HttpSmsApiService.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class HttpSmsApiService(private val apiKey: String, private val baseURL: URI) {
9191
if (!response.isSuccessful) {
9292
Timber.e("error response [${response.body?.string()}] with code [${response.code}] while receiving message [${body}]")
9393
response.close()
94-
return response.code == 422 || response.code == 401
94+
return response.code in 400..499
9595
}
9696

9797
val message = ResponseMessage.fromJson(response.body!!.string())
@@ -121,7 +121,7 @@ class HttpSmsApiService(private val apiKey: String, private val baseURL: URI) {
121121
if (!response.isSuccessful) {
122122
Timber.e("error response [${response.body?.string()}] with code [${response.code}] while sending missed call event [${body}]")
123123
response.close()
124-
return response.code == 422
124+
return response.code in 400..499
125125
}
126126

127127
response.close()

0 commit comments

Comments
 (0)