I see no contradiction here. For some applications it makes a total sense to define some kind of common framework-level "error container" class and use it everywhere. It is another approach to centralize your error handling, since you can have your project specific extension that handle the errors in the ways appropriate to your project. Since Kotlin is a general-purpose language, it is hard for us to provide something like this out-of-the-box to fit all the various domain-specific issues people have.

Written by

Project Lead for the Kotlin Programming Language @JetBrains

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store