Files
mev-beta/orig/@prompts/error-handling.md
Administrator c54c569f30 refactor: move all remaining files to orig/ directory
Completed clean root directory structure:
- Root now contains only: .git, .env, docs/, orig/
- Moved all remaining files and directories to orig/:
  - Config files (.claude, .dockerignore, .drone.yml, etc.)
  - All .env variants (except active .env)
  - Git config (.gitconfig, .github, .gitignore, etc.)
  - Tool configs (.golangci.yml, .revive.toml, etc.)
  - Documentation (*.md files, @prompts)
  - Build files (Dockerfiles, Makefile, go.mod, go.sum)
  - Docker compose files
  - All source directories (scripts, tests, tools, etc.)
  - Runtime directories (logs, monitoring, reports)
  - Dependency files (node_modules, lib, cache)
  - Special files (--delete)

- Removed empty runtime directories (bin/, data/)

V2 structure is now clean:
- docs/planning/ - V2 planning documents
- orig/ - Complete V1 codebase preserved
- .env - Active environment config (not in git)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-10 10:53:05 +01:00

1.1 KiB

You are an expert in Go error handling and logging best practices. I'm building an MEV bot in Go that needs robust error handling and comprehensive logging for production deployment.

I need help with:

  1. Implementing structured logging throughout the application
  2. Creating meaningful error messages for debugging
  3. Implementing retry mechanisms for transient failures
  4. Handling fatal errors gracefully
  5. Implementing circuit breakers for external services
  6. Creating health checks and metrics

Please provide production-ready Go code that:

  • Uses a structured logging library (like zap or logrus)
  • Implements comprehensive error wrapping and context
  • Includes retry mechanisms with exponential backoff
  • Handles fatal errors gracefully with proper cleanup
  • Follows Go best practices for error handling
  • Is optimized for performance
  • Includes comprehensive comments

The code should:

  • Log at appropriate levels (debug, info, warn, error)
  • Include contextual information in log messages
  • Implement circuit breakers for RPC connections
  • Handle timeouts appropriately
  • Provide health check endpoints
  • Export metrics for monitoring