Skip to content
Back to skills

Error Handling

ASecurity

Functional error handling using Dartz and Either.

  • 8 stars
  • 0 votes
  • 0 copies
  • 3 views
  • Added September 8, 2026
ai-agentsapi

Works with

  • api

Security analysis

A100/100

Pro scans all 3 files and shows the line behind each finding

Scanned September 8, 2026

npx -y skills add ngxtm/devkit --skill error-handling --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Error Handling?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Error Handling
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/ngxtm-error-handling/badge)](https://www.skillsdirectory.com/skills/ngxtm-error-handling)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: Flutter Error Handling
description: Functional error handling using Dartz and Either.
metadata:
  labels: [error-handling, dartz, functional]
  triggers:
    files: ['lib/domain/**', 'lib/infrastructure/**']
    keywords: [Either, fold, Left, Right, Failure, dartz]
---

# Error Handling

## **Priority: P1 (HIGH)**

Standardized functional error handling using `dartz` and `freezed` failures.

## Implementation Guidelines

- **Either Pattern**: Return `Either<Failure, T>` from repositories. No exceptions in UI/BLoC.
- **Failures**: Define domain-specific failures using `@freezed` unions.
- **Mapping**: Infrastructure catches `Exception` and returns `Left(Failure)`.
- **Consumption**: Use `.fold(failure, success)` in BLoC to emit corresponding states.
- **Typed Errors**: Use `left(Failure())` and `right(Value())` from `Dartz`.

## Reference & Examples

For Failure definitions and API error mapping:
See [references/REFERENCE.md](references/REFERENCE.md).

## Related Topics

layer-based-clean-architecture | bloc-state-management

Files in this skill

  • SKILL.md1 KB
  • references/REFERENCE.md488 B
  • references/error-mapping.md845 B

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…