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:
Joshua Humphries
2019-04-09 09:34:39 -04:00
committed by GitHub
parent f0723c6273
commit 5d6316f470
2 changed files with 177 additions and 21 deletions

View File

@@ -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)
}
}