-
Type:
Improvement
-
Resolution: Duplicate
-
Priority:
Trivial - P5
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
None
-
Go Drivers
-
None
-
None
-
None
-
None
-
None
-
None
Context
Right now CommandFailedEvent only exposes the error’s stringification. It should at least expose the plain error instead.
In REP-3858, mongosync is adding its new embedded verifier to existing end-to-end tests. That seems—unrelatedly?—to be causing a glut of StaleConfig errors and such, which mongosync doesn’t really care about and shouldn’t cause test failures.
I’d like to filter those errors out, but right now that requires parsing a string. It’d be much cleaner if I had the actual mongo.ServerError so I could extract error codes and parse that way. Right now, though, that doesn’t exist in CommandFailedEvent, which is how we report raw errors from the driver.
Definition of done
Add a member to CommandFailedEvent that includes the raw error. Retain the existing Failure member to preserve compatibility.
Pitfalls
None?
NB: If it’s not too late, I would think Go driver 2 would do well to use the raw error as Failure, and let applications call .Error() to get the string.
- duplicates
-
GODRIVER-2616 Change CommandFailedEvent.Failure type to error
-
- Closed
-