We are using latest driver v5, and when context is cancelled, the error returned from the ExecuteRead or similar function is ConnectionReadCanceled etc. It is in internal package (neo4j/internal/errorutil/bolt.go), so we cannot try to cast to the type.
And because none of the error types below implements Unwrap, the errors.Is() will not succeed either.
- ConnectionReadTimeout
- ConnectionWriteTimeout
- ConnectionReadCanceled
- ConnectionWriteCanceled
It should be sufficient to implement Unwrap method. No need to expose errors in public API.