mirror of
https://github.com/fullstorydev/grpcurl.git
synced 2026-05-22 19:51:44 +03:00
Adds support for showing error details (#98)
To better support printing of google.protobuf.Any messages (error details), this also makes a few other changes: 1. Allows printing of unresolvable Any messages using an "@value" field in JSON output that has the base64-encoded embedded message data. 2. Improves support for "-format text" to show expanded Any messages if possible. (Due to limitations in underlying proto package, this will usually *not* be that helpful. But this should greatly improve with v2 of the go protobuf API.) 3. Addresses a TODO in existing AnyResolver code to lazily fetch descriptors as needed instead of having to download all files eagerly.
This commit is contained in:
@@ -518,7 +518,7 @@ func main() {
|
||||
fmt.Printf("Sent %d request%s and received %d response%s\n", reqCount, reqSuffix, h.NumResponses, respSuffix)
|
||||
}
|
||||
if h.Status.Code() != codes.OK {
|
||||
fmt.Fprintf(os.Stderr, "ERROR:\n Code: %s\n Message: %s\n", h.Status.Code().String(), h.Status.Message())
|
||||
grpcurl.PrintStatus(os.Stderr, h.Status, formatter)
|
||||
exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user