Error Handling

Current error handling architecture and implementation patterns in Divekit.

Divekit uses a centralized categorized error model built around internal/error (apperror), command middleware, and internal/shell/logging.

This page is now only a summary. The implementation-coupled source of truth lives in the CLI repository under docs/architecture/error-handling.md.

Stable Summary

  • commands should return typed errors, not format terminal output themselves
  • user messages and technical details should stay separate
  • exit codes are determined centrally
  • logging should go through the shared logging package
  • fallback behavior should be explicit and observable

For package paths, current examples, and maintainer-level guidance, use the CLI repository document.