# Error Handling in Clojure with Value-and-Error Results

DevFeed: [Error Handling in Clojure with Value-and-Error Results](<https://devfeed.tech/articles/good-enough-error-handling-in-clojure-32093.md>)

Original publisher: [Read original article](<https://adambard.com/blog/acceptable-error-handling-in-clojure/>)

Published: 2013-05-13T00:00:00Z

Content type: tutorial

Language: en

Sources: [Adam Bard](<https://devfeed.tech/sources/adam-bard.md>)

Topics: [Clojure](<https://devfeed.tech/topics/clojure.md>), [Error Handling](<https://devfeed.tech/topics/error-handling.md>), [exceptions](<https://devfeed.tech/topics/exceptions.md>), [function](<https://devfeed.tech/topics/function.md>), [Code](<https://devfeed.tech/topics/code.md>)

Tags: [clojure](<https://devfeed.tech/tags/clojure.md>), [code](<https://devfeed.tech/tags/code.md>), [error-handling](<https://devfeed.tech/tags/error-handling.md>), [exceptions](<https://devfeed.tech/tags/exceptions.md>), [function](<https://devfeed.tech/tags/function.md>), [monad](<https://devfeed.tech/tags/monad.md>)

## AI overview

This tutorial presents a pragmatic approach to error handling in Clojure by returning either a value or an error message instead of throwing exceptions. It progressively composes validators and ends with a simple error-monad-like pattern.

## Source excerpt

Writing Clojure is not like writing Java. In Java, exceptions are an accepted part of the workflow; in Clojure, they are begrudgingly supported out of necessity, but generally avoided. Why is that? Probably because writing code that throws exceptions makes your functional code a lot less functional - that is, a lot less composable. When you can't trust a function to execute and return a value you lose some functional purity.