shlogg · Early preview
Kiolk @kiolk

Implementing Exception Handling For API Calls In KMM App

Crashed app when sorting orgs due to 500 error response from API. Fixed by implementing exception handling and wrapping result in presentation layer.

What I did:
Today, I have a two-part report on the progress. Yesterday, I worked on the searching logic for organizations. It worked well for finding organizations that matched the input. However, the application crashed when I tried to sort by the newest or oldest organizations. I wondered why this happened? I found that the response returned a 500 error with an HTML page in the body. The kotlinx.serialization library tries to parse it and throws an exception. I checked this behavior on the web and found the same response, so it isn't my fault. 
How can I address this issue? The general solut...