# frozen_string_literal: true # adn/tools/core/error_handler.rb — Helper para mensajes de error estandarizados # ============================================================================== # módulo reutilizable para formateo consistente de errores en CLI module ADN module ErrorHandler module_function def error(msg, code: 1) puts "#{Color::RED}✗ #{msg}#{Color::RESET}" exit(code) end def warning(msg) puts "#{Color::YELLOW}⚠ #{msg}#{Color::RESET}" end def info(msg) puts "#{Color::CYAN}ℹ #{msg}#{Color::RESET}" end def success(msg) puts "#{Color::GREEN}✓ #{msg}#{Color::RESET}" end def debug(msg) puts "#{Color::DIM}🔍 #{msg}#{Color::RESET}" if ENV['ADN_DEBUG'] end def die(msg, code: 1) error(msg, code: code) end end end