Add Error Handling and Logging for Invalid Paths/Methods
Description
Implement comprehensive error handling and logging for incorrect paths and HTTP methods. This includes custom error responses, structured logging, and complete test coverage for error scenarios.
Technical Requirements
Error Handling
- Create custom error types for different scenarios
- Implement middleware for catching invalid paths
- Add method validation middleware
- Structure error responses consistently
Logging Implementation
- Add structured logging using zerolog
- Log request details (path, method, timestamp)
- Include correlation IDs
- Add log levels for different scenarios
Testing Requirements
- Test invalid paths
- Test invalid methods
- Test logging output
- Test error response format
- Test correlation ID propagation
Documentation Updates
- Add error response format
- Document logging structure
- Update API documentation
- Add troubleshooting guide