# From error-handling to structured concurrency

DevFeed: [From error-handling to structured concurrency](<https://devfeed.tech/articles/from-error-handling-to-structured-concurrency-21946.md>)

Original publisher: [Read original article](<https://blog.nelhage.com/post/concurrent-error-handling/>)

Author: Nelson Elhage

Published: 2026-03-23T15:30:00Z

Content type: opinion

Language: en

Sources: [Nelson Elhage](<https://devfeed.tech/sources/nelson-elhage.md>)

Topics: [Concurrency](<https://devfeed.tech/topics/concurrency.md>), [Concurrent Programming](<https://devfeed.tech/topics/concurrent-programming.md>), [Error Handling](<https://devfeed.tech/topics/error-handling.md>), [Exception](<https://devfeed.tech/topics/exception.md>)

Tags: [concurrency](<https://devfeed.tech/tags/concurrency.md>), [error-handling](<https://devfeed.tech/tags/error-handling.md>), [examples](<https://devfeed.tech/tags/examples.md>), [exception](<https://devfeed.tech/tags/exception.md>), [exception-handling](<https://devfeed.tech/tags/exception-handling.md>), [structured-concurrency](<https://devfeed.tech/tags/structured-concurrency.md>)

## AI overview

This article examines how error-handling patterns based on stack unwinding and cleanup should be adapted for concurrent programs with multiple tasks. It introduces the problem of unhandled errors in concurrent execution and compares possible behaviors when one task fails.

## Source excerpt

How should we think about error-handling in concurrent programs? In single-threaded programs, we've mostly converged on a standard pattern, with a diverse zoo of implementations and concrete patterns. When an error occurs, it is propagated up the stack until we find a stack frame which is prepared to handle it. As we do so, we unwind the stack frames in-order, giving each frame the opportunity to clean up or destroy resources as appropriate.