Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -159,4 +159,8 @@ fun setupDefaultHttpClient(
install(ContentNegotiation) {
json(jsonConfig)
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To prevent application crashes when the API fails for reasons such as network issues or server problems, we must implement client-side error handling, preferably by using a try-catch block or a custom interceptor or a sealed interface/class with custom errors data classes with serializable fields

// Enable response validation to throw exceptions for non-2xx responses
// This allows proper error handling with ClientRequestException (4xx) and ServerResponseException (5xx)
expectSuccess = true
}
Loading