elixir-grpc / grpc

An Elixir implementation of gRPC
https://hex.pm/packages/grpc
Apache License 2.0
1.36k stars 210 forks source link

Translate errors from HTTP statuses #362

Open v0idpwn opened 2 months ago

v0idpwn commented 2 months ago

This is inspired in how GRPC go approaches HTTP errors when performing GRPC requests.

Error translation is useful in different situations. For example, AWS load balancer replies with a 504 when there are no live instances. There, a unavailable error is much more fitting than internal.

For go translation table: https://github.com/grpc/grpc-go/blob/273fe145d03df516018cf4642e6987e027ffc0f5/internal/transport/http_util.go#L68

v0idpwn commented 2 months ago

I didn't find where these errors are handled in Mint (if they are), so I didn't touch it. I'm not using Mint either.

sleipnir commented 1 month ago

@v0idpwn any progress here?

v0idpwn commented 2 weeks ago

Hi, @sleipnir. I did an attempt at implementing it on the mint adapter, but ended up hitting a wall. I'll give it another stab soonish.