We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 241b081 commit 6fe13d1Copy full SHA for 6fe13d1
memdx/errors.go
@@ -5,6 +5,7 @@ import (
5
"errors"
6
"fmt"
7
"strconv"
8
+ "time"
9
)
10
11
var (
@@ -260,3 +261,19 @@ func (e DcpRollbackError) Error() string {
260
261
func (e DcpRollbackError) Unwrap() error {
262
return ErrDcpRollback
263
}
264
+
265
+type ErrorWithServerDuration struct {
266
+ Cause error
267
+ ServerDuration time.Duration
268
+}
269
270
+func (e ErrorWithServerDuration) Error() string {
271
+ return fmt.Sprintf(
272
+ "%s (server duration: %s)",
273
+ e.Cause,
274
+ e.ServerDuration)
275
276
277
+func (e ErrorWithServerDuration) Unwrap() error {
278
+ return e.Cause
279
0 commit comments