diff --git a/core-base/network/src/commonMain/kotlin/template/core/base/network/KtorHttpClient.kt b/core-base/network/src/commonMain/kotlin/template/core/base/network/KtorHttpClient.kt index e9d9584f..3a776b9a 100644 --- a/core-base/network/src/commonMain/kotlin/template/core/base/network/KtorHttpClient.kt +++ b/core-base/network/src/commonMain/kotlin/template/core/base/network/KtorHttpClient.kt @@ -159,4 +159,8 @@ fun setupDefaultHttpClient( install(ContentNegotiation) { json(jsonConfig) } + + // Enable response validation to throw exceptions for non-2xx responses + // This allows proper error handling with ClientRequestException (4xx) and ServerResponseException (5xx) + expectSuccess = true }