Commit 1212cdd
authored
feat: add structured error responses for handler errors (#57)
* feat(errors): add Error proto message for structured handler errors
- Add Error message with string message field
- Provides structured error responses for handler failures
- Consistent with existing ValidationError pattern
* build(proto): regenerate Go code with new Error message
- Update errors.pb.go with Error type and methods
- Regenerate annotations.pb.go and headers.pb.go with latest protoc
- Generated code includes proper protobuf bindings for Error message
* feat(httpgen): replace plain string errors with structured Error responses
- Add generateWriteErrorResponseFunc to create error response helper
- Replace http.Error calls with structured sebufhttp.Error messages
- Apply consistent error handling for handler, marshal, and write errors
- Maintain HTTP 500 status code for internal server errors
- Serialize errors as JSON/protobuf based on request Content-Type
* chore(dev): update coverage reports and development settings
- Update coverage badge and reports after test execution
- Update local Claude settings for development workflow
* docs: update documentation for structured error handling
- Add comprehensive error handling section to http-generation.md
- Document Error proto message and handler error responses
- Update key features to include structured error responses
- Modernize CLAUDE.md examples to use structured error functions
- Add error hierarchy and response format examples
- Include JSON and protobuf serialization details
Reflects new Error message implementation and writeErrorResponse function.
* refactor(httpgen): eliminate code duplication in error response functions
- Extract common logic into shared writeProtoMessageResponse helper
- Replace duplicated marshaling logic in validation and handler error functions
- Fix golangci-lint duplication warnings (dupl)
- Maintain identical functionality while reducing code repetition
- Fix line length formatting issues1 parent 9c38676 commit 1212cdd
File tree
11 files changed
+1821
-50
lines changed- .claude
- coverage
- docs
- http
- internal/httpgen
- proto/sebuf/http
11 files changed
+1821
-50
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
| 43 | + | |
43 | 44 | | |
44 | 45 | | |
45 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
89 | | - | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
100 | 92 | | |
101 | 93 | | |
102 | 94 | | |
| |||
265 | 257 | | |
266 | 258 | | |
267 | 259 | | |
268 | | - | |
269 | | - | |
270 | | - | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
271 | 266 | | |
272 | 267 | | |
273 | 268 | | |
| |||
Loading
0 commit comments