Closed learntechpuzz closed 5 years ago
Hello,
I apologize for the late response. Are you proposing that grammes should handle errors that do not correspond to documented error codes from the Gremlin server? From how I'm reading this it seems you'd like this response to be handled as an error, but is just a warning of sorts.
I'm reading: http://tinkerpop.apache.org/javadocs/3.2.4/full/index.html?org/apache/tinkerpop/gremlin/driver/message/ResponseStatusCode.html for all the error codes that are handled by the client.
After re-reading I believe what you are informing me about is that the error message isn't inherently available using just the grammes client.
In this file you can see any error messages are returned into the errs
channel which is accessible via the grammes concurrent error handling channel when setting up the client.
I apologize for not providing an example in the examples/
directory. I must've deleted it at some point when cleaning up the repo. I'll re-add it in there. For now I will just provide one...
What I suggest doing is:
func main() {
// Create an error channel to handle all error handling concurrently.
errs := make(chan error)
go func(chan error) {
err := <-errs
fmt.Printf("error with grammes client: %v\n", err)
}(errs)
// Use the WithErrorChannel ClientConfiguration to use the errors channel.
_, err := grammes.DialWithWebSocket("ws://127.0.0.1:8182", grammes.WithErrorChannel(errs))
// ...more code
}
Hope this helps.
gremconnect\response.go line no: 60 //resp.Data = err // Use the Data field as a vehicle for the error. Let take a example: Try to execute query "ExecuteStringQuery" which possibly returns "Edge is already exists" at the Gremlin Server but it is not handled properly in response []byte
Suggestion: resp.Data = message // Changes to handle error messages.