[v4] support error handling flow like gRPC (#158)
Some checks failed
sync / sync (push) Failing after 1h5m56s
test / test (push) Failing after 1h9m11s
coverage / build (push) Failing after 1h9m22s

* add status package with tests and integrate into response parsing
* improve unit-tests
* improve readme
This commit is contained in:
2025-09-30 12:28:39 +05:00
committed by GitHub
parent 9bb2f8cffa
commit 6209a03044
7 changed files with 308 additions and 26 deletions

14
status/error.go Normal file
View File

@@ -0,0 +1,14 @@
package status
// Error is a thin wrapper around Status that implements the error interface.
type Error struct {
s *Status
}
func (e *Error) Error() string {
return e.s.String()
}
func (e *Error) HTTPStatus() *Status {
return e.s
}