Skip to content

Commit dbd6a5f

Browse files
authored
Merge pull request #254 from jsafrane/log-error-code
Log full error code
2 parents 613e928 + 011fc41 commit dbd6a5f

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

driver/driver.go

+11-4
Original file line numberDiff line numberDiff line change
@@ -219,15 +219,22 @@ func logGRPC(method string, request, reply interface{}, err error) {
219219
Method string
220220
Request interface{}
221221
Response interface{}
222-
Error string
222+
// Error as string, for backward compatibility.
223+
// "" on no error.
224+
Error string
225+
// Full error dump, to be able to parse out full gRPC error code and message separately in a test.
226+
FullError error
223227
}{
224-
Method: method,
225-
Request: request,
226-
Response: reply,
228+
Method: method,
229+
Request: request,
230+
Response: reply,
231+
FullError: err,
227232
}
233+
228234
if err != nil {
229235
logMessage.Error = err.Error()
230236
}
237+
231238
msg, _ := json.Marshal(logMessage)
232239
fmt.Printf("gRPCCall: %s\n", msg)
233240
}

0 commit comments

Comments
 (0)