# Signatures, be true: domain errors and functional handling in Kotlin

DevFeed: [Signatures, be true: domain errors and functional handling in Kotlin](<https://devfeed.tech/articles/signatures-be-true-domain-errors-and-functional-handling-in-kotlin-8792.md>)

Original publisher: [Read original article](<https://blog.jetbrains.com/kotlin/2026/08/signatures-be-true-domain-errors-and-functional-handling-in-kotlin/>)

Author: Alina Dolgikh

Published: 2026-08-19T15:52:05Z

Content type: article

Language: en

Sources: [Kotlin : A concise multiplatform language developed by JetBrains | The JetBrains Blog](<https://devfeed.tech/sources/kotlin-a-concise-multiplatform-language-developed-by-jetbrains-the-jetbrains-blog.md>)

Topics: [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Code](<https://devfeed.tech/topics/code.md>), [Exception](<https://devfeed.tech/topics/exception.md>), [API](<https://devfeed.tech/topics/api.md>), [Database](<https://devfeed.tech/topics/database.md>), [engineering-culture](<https://devfeed.tech/topics/engineering-culture.md>)

Tags: [api](<https://devfeed.tech/tags/api.md>), [article](<https://devfeed.tech/tags/article.md>), [backend](<https://devfeed.tech/tags/backend.md>), [code](<https://devfeed.tech/tags/code.md>), [database](<https://devfeed.tech/tags/database.md>), [engineering-culture](<https://devfeed.tech/tags/engineering-culture.md>), [exception](<https://devfeed.tech/tags/exception.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>)

## AI overview

An article about making expected domain failures explicit in Kotlin function signatures through sealed types and functional error handling. It argues that business-logic failures should be visible in the function signature, API contract, and client handling code rather than hidden in implementations or exception handlers.

## Source excerpt

Here's a function that signs a document: In Kotlin, Unit means the function completes without returning a meaningful value - roughly equivalent to void in Java. Got it? Now, tell me what could go wrong. You can't. Yet, the code might be invalid. The signing window might have closed. The database might be down. The [...]