Commit 65dedd1
feat: replace single error handler with three-callback pattern in strict gin template
Split the single ErrorHandlerFunc into three distinct callbacks to give
callers control over error responses by category:
- RequestErrorHandlerFunc: request parsing/binding errors (default 400)
- HandlerErrorFunc: application handler errors (default 500)
- ResponseErrorHandlerFunc: response serialization errors (default 500)
This also fixes two bugs in the original template:
- Missing multipart boundary now passes http.ErrMissingBoundary instead
of a nil error
- Unexpected response type now passes a descriptive error instead of nil
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 0e5ca22 commit 65dedd1
8 files changed
Lines changed: 331 additions & 130 deletions
File tree
- internal/test
- issues
- issue-1093/api
- child
- parent
- issue-1208-1209
- issue-1212
- pkg1
- pkg2
- issue-1298
- strict-server/gin
- pkg/codegen/templates/strict
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 34 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments