Codenic Clean Architecture
  • Introduction
  • The Clean Architecture
    • Presentation Layer
    • Domain Layer
    • Infrastructure Layer
  • Tutorial
    • Overview
    • Creating a Flutter Modular Project
      • Tips for Managing a Modular Project
    • Implementing the Domain Layer
      • Core Dependencies
      • Creating an Entity
      • Creating a Failure
      • Creating a Repository Interface
      • Creating Use Cases
        • CRUD Operations (Runner)
        • Data Streams (Watcher)
    • Implementing the Infrastructure Layer
      • External Dependencies
      • Creating a Data Model
      • Creating a Data Source
      • Implementing a Repository
    • Implementing the Presentation Layer
      • External Dependencies
      • Dependency Injection and Service Locator
      • Widgets
        • Snackbar Handler
        • Global Blocs Widget
        • Note Widgets
  • Packages
    • Codenic Bloc Use Case
      • Runner
      • Watcher
    • Codenic Logger
      • Usage
      • Example
      • Modifying the Logger
      • Integrating Firebase Crashlytics to the logger
    • Codenic Exception Converter
      • Failure Object
      • Exception Converter
      • Exception Converter Suite
      • Example
Powered by GitBook
On this page
  • What does it do?
  • Installation
  • 1. Add the dependency
  • 2. Build your app
  • Next Steps
  1. Packages

Codenic Exception Converter

PreviousIntegrating Firebase Crashlytics to the loggerNextFailure Object

Last updated 2 years ago

What does it do?

The provides a utility tool for converting Exception into Failure objects.

By converting exceptions into failure objects, the program can handle exceptions in a more generic way, rather than being tied to the specific details of a particular technology or framework. This can make it easier to write code that is more portable and easier to maintain, as it is not tied to the specifics of any particular technology.

This tool includes the following classes for conveniently converting Exceptions into Failures:

Class
Description

The base class of all Failure objects.

A task observer class for converting a particular Exception into a Failure (must be paired with an Exception Converter Suite).

A task observer with a collection of Exception Converters for converting any Exceptions into their respective Failures.

Installation

1. Add the dependency

Add the Dart package in your pubspec.yaml by running the following command in the root of your project:

dart pub add codenic_exception_converter

2. Build your app

Install the package by calling:

dart pub get

Next Steps

Once installed, view the Usage documentation to get started.

This package has a built-in integration with the , which allows it to generate log outputs as needed. In addition, this uses Either monad for managing union types.

Codenic Logger
fpdart's
Failure
Exception Converter
Exception Converter Suite
Codenic Exception Converter package