-
Couldn't load subscription status.
- Fork 16
Feat/add structured error logging #84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat/add structured error logging #84
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
38e2935 to
640a2d5
Compare
@Ja4V8s28Ck |
- Add comprehensive test suite for errors package (100% coverage) * Test all error constructors (NotFound, BadRequest, Conflict, etc.) * Test validation error conversion from Gin/validator * Test error middleware with various error types * Test integration scenarios with router - Improve code documentation * Add godoc comments for all exported types and functions * Remove excessive obvious comments per project standards * Document error codes and their purposes * Add examples and edge case documentation - Fix test expectations for structured error responses * Update handler tests to check 'message' field * Ensure consistent error response validation - Update Swagger documentation * Regenerate docs with new error types This enhances the structured error handling system with: - Industry-standard test coverage (100%) - Clear documentation following Go conventions - Consistent error handling patterns - Better developer experience with type-safe errors Co-authored-by: Ja4V8s28Ck <Ja4V8s28Ck@users.noreply.github.com>
- Add ERROR_HANDLING.md with complete guide to structured error system * Overview of error response structure * All error codes with descriptions and examples * Real-world curl examples for each error type * Client-side error handling in TypeScript, Python, and Go * Best practices and anti-patterns * Testing error responses * Integration with logging and monitoring - Update mkdocs.yml navigation * Create new 'API Features' section * Move error handling, rate limiting, and logging together * Improve documentation organization This documentation provides: - Complete API error reference for developers - Client integration examples in multiple languages - Best practices for error handling patterns - Testing strategies for error scenarios Related to: vahiiiid/go-rest-api-boilerplate#84
640a2d5 to
2079ef4
Compare
- Mark universal-translator as direct dependency in go.mod (used in error tests) - Add structured error handling to README features list - Add Error Handling section to README with link to docs - Add error handling link to documentation reference section Co-authored-by: Ja4V8s28Ck <Ja4V8s28Ck@users.noreply.github.com>
|
I removed the commit with the 404 fixing of the delete user since it's fixed in the other PR Please have a look |
Thanks for polishing the PR into a better one. 🙏 |
- Add ERROR_HANDLING.md with complete guide to structured error system * Overview of error response structure * All error codes with descriptions and examples * Real-world curl examples for each error type * Client-side error handling in TypeScript, Python, and Go * Best practices and anti-patterns * Testing error responses * Integration with logging and monitoring - Update mkdocs.yml navigation * Create new 'API Features' section * Move error handling, rate limiting, and logging together * Improve documentation organization This documentation provides: - Complete API error reference for developers - Client integration examples in multiple languages - Best practices for error handling patterns - Testing strategies for error scenarios Related to: vahiiiid/go-rest-api-boilerplate#84
Description
delete endpointwith a non-existentuser IDwill not returnUSER_NOT_FOUND, rather it returnsINTERNAL_SERVER_ERROR. ( I have added it as the last commit so that it can be cherry picked as a new PR, incase a need arise. ).envfile with the existingconfig.yaml, there is a testcase ingo-rest-api-boilerplate/internal/config/config_test.go
Lines 650 to 666 in 96aaf12
.envwith aDATABASE_PORTvalue populated. So if uses with customDATABASE_PORTin.envfile will notice that, this test is failing.Type of Change
How Has This Been Tested?
Checklist: