flutter-error-handling
БесплатноБез исполняемых скриптовНе проверенFunctional error handling with Either/Failure. ALWAYS consult when writing repositories, handling exceptions, defining failures, or using Either in any…
от ComeOnOliver★ 67 звёзд на GitHubОб этом скилле
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 (e.g.,
UnauthorizedFailure,OutOfStockFailure). - Mapping: Infrastructure catches Exception (e.g.,
DioException) and returns Left(Failure). Never rethrow to UI. - Consumption: Use .fold(failure, success) in BLoC to emit corresponding states. Remove try/catch from BLoC.
- Typed Errors: Use
left(Failure())andright(Value())fromDartz. - Low-Cardinality Logging: Use stable message templates; pass variable data via metadata/context.
- Layer Restriction: try/catch only in Infrastructure. UI/Application/BLoC layers should not catch.
- Localization: Use
failure.failureMessage(returns TRObject or localized string) for UI-safe text. - Right/Left Restriction: Only Infrastructure may construct
Right()/Left(). - No Silent Catch: Never swallow errors without logging or a documented retry.
Reference & Examples
For Failure definitions and API error mapping: See references/REFERENCE.md.
Anti-Patterns
- ❌
try { … } catch (e) { emit(ErrorState()); }in BLoC — try/catch belongs only in Infrastructure; BLoC receivesEither, then folds - ❌
Left(Failure('Something went wrong'))using a plainString— define typed@freezedFailure subclasses for each domain error - ❌
catch (e) {}empty catch — always log and propagate; never swallow silently - ❌ Throwing
Exceptionfrom a repository — returnLeft(Failure)instead; exceptions must not cross the infrastructure boundary
Related Topics
layer-based-clean-architecture | bloc-state-management
Установить flutter-error-handling в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
FAQ
Что делает скилл flutter-error-handling?
Functional error handling with Either/Failure. ALWAYS consult when writing repositories, handling exceptions, defining failures, or using Either in any Flutter layer — not just when setting up error handling. (triggers: lib/domain/**, lib/infrastructure/**, Either, fold, Left, Right, Failure, dartz)
Как установить скилл flutter-error-handling?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл flutter-error-handling запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
doc-coauthoring
Guide users through a structured workflow for co-authoring documentation. Use when user wants to write documentation, proposals, technical specs, decision…
от Anthropicacademy-guide
Stop and check this skill before finishing any reply to a question about how to use Claude or a Claude product — it recommends matching courses, tutorials…
от Anthropicinternal-comms
A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill…
от Anthropicskill-development
This skill should be used when the user wants to "create a skill", "add a skill to plugin", "write a new skill", "improve skill description", "organize skill…
от Anthropic