Skip to content

Log full error code #254

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 20, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions driver/driver.go
Original file line number Diff line number Diff line change
Expand Up @@ -219,15 +219,22 @@ func logGRPC(method string, request, reply interface{}, err error) {
Method string
Request interface{}
Response interface{}
Error string
// Error as string, for backward compatibility.
// "" on no error.
Error string
// Full error dump, to be able to parse out full gRPC error code and message separately in a test.
FullError error
}{
Method: method,
Request: request,
Response: reply,
Method: method,
Request: request,
Response: reply,
FullError: err,
}

if err != nil {
logMessage.Error = err.Error()
}

msg, _ := json.Marshal(logMessage)
fmt.Printf("gRPCCall: %s\n", msg)
}
Expand Down