🧠
Funkcia Docs
🧠
Funkcia Docs
  • Welcome
  • Data types
    • Option
      • Error Propagation
      • Do Notation
    • Result
      • Error Propagation
      • Do Notation
    • OptionAsync
      • Error Propagation
      • Do Notation
    • ResultAsync
      • Error Propagation
      • Do Notation
  • Modules
    • Exceptions
    • Functions
    • JSON
    • Predicate
    • URI
    • URL
Powered by GitBook
On this page
  • Base Error Class
  • General Exceptions

Was this helpful?

Edit on GitHub
  1. Modules

Exceptions

The Exceptions module provides a set of custom error types used throughout Funkcia for type-safe error handling.

Base Error Class

TaggedError

Extend your errors using this abstract class to enforce _tag identifiers, making error handling easier in your application.

An abstract base class for errors that require a tag for identification.

import { TaggedError } from 'funkcia/exceptions';

class UserNotFound extends TaggedError {
  readonly _tag: 'UserNotFound'
}

General Exceptions

UnwrapError

Error thrown when attempting to unwrap a None value from an Option or an Error value from a Result.

UnknownError

A wrapper for errors caught in try/catch blocks in a Result.

NoValueError

Error used when a nullable value is converted to a Result and is null | undefined.

FailedPredicateError

Error used when a predicate check fails in a Result chain.

PreviousDo NotationNextFunctions

Last updated 3 months ago

Was this helpful?