open-traffic-generator / snappi

Open Traffic Generator SDK in Python and Go
MIT License
69 stars 7 forks source link

snappi 0.7.13 grpc transport is returning errors without status code #153

Closed biplamal closed 2 years ago

biplamal commented 2 years ago

for bad json & invalid values/types snappi grpc transport raising exception with out any status code.

http-transport raised exception:

expected_exception = Exception( 400, { 'errors': ( [ 'unmarshal error syntax error (line 3:23):' ' unexpected token "rx"'] ) } )

grpc-transport raised exception:

expected_exception = Exception( 'Failed to parse port_names field: repeated field ' 'port_names must be in [] which is rx..' )

alakendu commented 2 years ago

We are raising exception (with error code, errors) when we will get some error response (not 200) from server. But in this case the exception is coming before send it to channel. So, I am little concern to raise a response code in this case. Because we are getting this from deserialization in grpc pb2 format which is nothing but a wrapper code on top of grpc channel. As well as errors should differ.

biplamal commented 2 years ago

Got your point