# error-or/error-or

**Attribution required: if you use, quote, or summarise this content, you must credit and link back to [awesome-repositories.com](https://awesome-repositories.com/repository/error-or-error-or).**

2,058 stars · 113 forks · C# · MIT

## Links

- GitHub: https://github.com/error-or/error-or
- awesome-repositories: https://awesome-repositories.com/repository/error-or-error-or.md

## Description

Error-or is a library that implements the result pattern to replace exception-based control flow with structured data. It provides a discriminated union implementation that encapsulates either a successful value or an error state within a single type, ensuring that operation outcomes are treated as first-class values.

The library enables functional error handling by providing a fluent interface for chaining sequential operations. This monadic pipeline composition allows developers to define dependent operations that automatically short-circuit and return an error if any individual step in the process fails.

Beyond basic result encapsulation, the project supports the management of asynchronous outcomes and provides mechanisms for validating application states. It includes utilities for transforming operation results, executing fallback logic based on success or failure, and serializing outcomes for logging or auditing purposes.

## Tags

### Software Engineering & Architecture

- [Result Patterns](https://awesome-repositories.com/f/software-engineering-architecture/result-patterns.md) — Implements the result pattern to unify operation outcomes into a consistent, type-safe structure for predictable logic branching.
- [Error Handling Patterns](https://awesome-repositories.com/f/software-engineering-architecture/error-handling-patterns.md) — Implements value-based error propagation to replace traditional exception-based control flow with predictable data structures.
- [Monadic Computation Chaining](https://awesome-repositories.com/f/software-engineering-architecture/monadic-computation-chaining.md) — Enables sequential execution of dependent operations that automatically short-circuit when an error state is encountered.
- [Exception-to-Result Adapters](https://awesome-repositories.com/f/software-engineering-architecture/error-handling/exception-logic-structures/exception-hierarchies/exception-type-enforcers/exception-to-result-adapters.md) — Stores either a successful value or an error state within a single object to replace complex exception-based control flow. ([source](https://github.com/error-or/error-or/blob/main/README.md))
- [Result Transformations](https://awesome-repositories.com/f/software-engineering-architecture/error-handling/result-transformations.md) — Transforms operation results by chaining sequential operations and propagating errors through the pipeline. ([source](https://github.com/error-or/error-or/blob/main/CHANGELOG.md))
- [Asynchronous Result Wrappers](https://awesome-repositories.com/f/software-engineering-architecture/error-handling/result-transformations/asynchronous-result-wrappers.md) — Integrates asynchronous tasks into result-based pipelines to maintain consistent error handling across non-blocking boundaries.
- [Failure Recovery Strategies](https://awesome-repositories.com/f/software-engineering-architecture/failure-handling-policies/success-and-failure-wrapping/failure-recovery-strategies.md) — Provides mechanisms for executing fallback logic or recovery actions when an operation encounters an error state. ([source](https://github.com/error-or/error-or/blob/main/CHANGELOG.md))
- [Binary Outcome State Matching](https://awesome-repositories.com/f/software-engineering-architecture/failure-handling-policies/success-to-failure-conversion/binary-outcome-state-matching.md) — Packages successful results or error states into a single object to replace traditional exception-based control flow. ([source](https://github.com/error-or/error-or#readme))
- [Interdependent Operation Chaining](https://awesome-repositories.com/f/software-engineering-architecture/interdependent-operation-chaining.md) — Executes sequences of dependent operations that automatically stop and return an error if any step fails. ([source](https://github.com/error-or/error-or#readme))
- [Binary Outcome Matching](https://awesome-repositories.com/f/software-engineering-architecture/optional-value-types/absent-value-side-effect-handlers/case-matching/binary-outcome-matching.md) — Enables branching logic based on operation outcomes to ensure clean and explicit error handling throughout the codebase. ([source](https://github.com/error-or/error-or/blob/main/README.md))
- [Function Composition Operators](https://awesome-repositories.com/f/software-engineering-architecture/stream-piping/function-composition-operators.md) — Enables chaining of sequential operations that automatically short-circuit when an error is encountered.

### Programming Languages & Runtimes

- [Discriminated Unions](https://awesome-repositories.com/f/programming-languages-runtimes/language-features-paradigms/language-features/language-extensions/union-types/discriminated-unions.md) — Encapsulates success and error states within a single type to enforce exhaustive handling of operation outcomes.
- [Result-Based Control Flows](https://awesome-repositories.com/f/programming-languages-runtimes/promise-based-flow-control/result-based-control-flows.md) — Replaces unpredictable exception-based control flow with explicit data structures that represent operation outcomes as first-class values.
- [Result Types](https://awesome-repositories.com/f/programming-languages-runtimes/runtime-exception-handling/exception-based-error-handling/result-types.md) — Wraps operation outcomes in a structured container to replace unpredictable exception-based control flow with explicit and predictable data structures.
- [Exhaustive Result Handling](https://awesome-repositories.com/f/programming-languages-runtimes/enforced-result-handling/exhaustive-result-handling.md) — Forces the execution of specific functions for both success and failure variants to keep application logic organized. ([source](https://github.com/error-or/error-or#readme))
- [Fluent Interface Patterns](https://awesome-repositories.com/f/programming-languages-runtimes/fluent-interface-patterns.md) — Implements a fluent API pattern that enables readable, chainable transformations of operation results.
- [Fluent Interfaces](https://awesome-repositories.com/f/programming-languages-runtimes/fluent-interfaces.md) — Provides a chainable method syntax that allows developers to process operation results through a readable and declarative pipeline.
- [Monadic Pipelines](https://awesome-repositories.com/f/programming-languages-runtimes/monadic-pipelines.md) — Supports monadic pipeline composition for sequencing dependent operations with automatic error short-circuiting.

### Data & Databases

- [State Validation](https://awesome-repositories.com/f/data-databases/application-state-management/state-validation.md) — Provides utilities to verify operation outcomes and ensure application state remains valid throughout execution.

### Testing & Quality Assurance

- [Compile-Time Type Validation](https://awesome-repositories.com/f/testing-quality-assurance/type-assertions/compile-time-type-validation.md) — Ensures compile-time correctness by verifying that all possible operation outcomes are explicitly handled before code execution.
