p4runtime-go-client icon indicating copy to clipboard operation
p4runtime-go-client copied to clipboard

Handle and parse error

Open saynb opened this issue 1 year ago • 2 comments

Only the top level error is handled today. We need a way to be able to parse the individual update errors in a batch

saynb avatar Aug 30 '23 19:08 saynb

@antoninbas Any insight on this ?

saynb avatar Aug 30 '23 19:08 saynb

That sounds like the right thing to do. At the moment, we call the Write RPC and return the error from the gRPC as is: https://github.com/antoninbas/p4runtime-go-client/blob/0c0dbfb137b1479732ab1078fb05e8740c5e65f1/pkg/client/client.go#L146-L147 We should probably extract the inner errors and return a custom Golang error type which is more user-friendly. Feel free to take a stab at this if you have some cycles.

antoninbas avatar Sep 18 '23 18:09 antoninbas