Comments (7)
gRPC error returned from grpc-gateway
is still http 200 but with error object as JSON returned iirc.
from protoc-gen-grpc-gateway-ts.
@lyonlai I don't, but I should be able to easily do, just wanted to check up front. I will do the changes and verify it with my use case, and send a PR.
from protoc-gen-grpc-gateway-ts.
@remko You could just check the error object instead.
from protoc-gen-grpc-gateway-ts.
@lyonlai No,grpc-gateway
maps gRPC codes to HTTP
< HTTP/1.1 401 Unauthorized
< Content-Type: application/json; charset=utf-8
< Date: Tue, 18 May 2021 05:46:57 GMT
< Content-Length: 40
<
{"status":401,"message":"Unauthorized"}
from protoc-gen-grpc-gateway-ts.
@atreya2011 There's no unambiguous way to check for an error object at that level. I would have to check for the presence of status
and message
properties, which could exist on a regular object too (e.g. a chat service presence message would have those fields)
Moreover, I would need to manually do this check for every call, or at least manually wrap every call, which is tedious.
from protoc-gen-grpc-gateway-ts.
hmm. I see, that make sense. @remko do you have something already and you wanted to contribute?
from protoc-gen-grpc-gateway-ts.
awesome, expecting it.
from protoc-gen-grpc-gateway-ts.
Related Issues (20)
- Use `import type` for type imports in template HOT 6
- Add optional fields support HOT 8
- Send bytes in a message HOT 1
- TextDecoderStream is not available on Firefox HOT 1
- Inconsistent Well-Known Types handling with grpc-gateway HOT 13
- Support of required fields
- Add client side streaming support HOT 1
- Google-recommended way of structuring resource path is not supported (https://google.aip.dev/127) HOT 2
- Add query params to DELETE methods
- Support additional_bindings HOT 1
- does not support golang 1.18?
- Generated TS types for google.protobuf.Timestamp do not match grpc-gateway encoding
- Windows - Back-slashes in generated import statements HOT 1
- Support for annotating deprecated fields
- Sending bytes as query param HOT 2
- Invalid module name for proto files with dashes or dots in name
- renderURLSearchParams doesn't render BoolValue and other well-known wrapper types correctly HOT 2
- Publish to buf.build HOT 4
- BUG: Field containing number are are inconsistent with proto JSON Mapping done by gateway HOT 1
- Messagepack as codec
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from protoc-gen-grpc-gateway-ts.