File tree 2 files changed +5
-1
lines changed
mobile/shared/src/commonMain/kotlin/com/ktnotes
2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change 1
1
package com.ktnotes.di
2
2
3
+ import com.ktnotes.exception.BadRequestException
3
4
import com.ktnotes.feature.auth.model.AuthResponse
4
5
import com.ktnotes.feature.auth.model.RefreshTokenRequest
5
6
import com.ktnotes.helper.postWithJsonContent
@@ -103,7 +104,7 @@ fun createHttpClient(
103
104
validateResponse { response: HttpResponse ->
104
105
if (response.status == HttpStatusCode .BadRequest && response.contentType() == ContentType .Application .Json ) {
105
106
val messageResponse = Json .decodeFromString<MessageResponse >(response.body())
106
- throw Exception (messageResponse.message)
107
+ throw BadRequestException (messageResponse.message)
107
108
}
108
109
}
109
110
}
Original file line number Diff line number Diff line change
1
+ package com.ktnotes.exception
2
+
3
+ data class BadRequestException (override val message : String ):Exception(message)
You can’t perform that action at this time.
0 commit comments