Initial commit: Set up MEV bot project structure
This commit is contained in:
27
@prompts/error-handling.md
Normal file
27
@prompts/error-handling.md
Normal file
@@ -0,0 +1,27 @@
|
||||
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
|
||||
Reference in New Issue
Block a user