You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 1, 2021. It is now read-only.
Copy file name to clipboardExpand all lines: README.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,17 +19,17 @@ if err != nil {
19
19
return errors.Wrap(err, "read failed")
20
20
}
21
21
```
22
-
In addition, errors.Wrap records the file and line where it was called, allowing the programmer to retrieve the path to the original error.
22
+
In addition, `errors.Wrap` records the file and line where it was called, allowing the programmer to retrieve the path to the original error.
23
23
24
24
## Retrieving the cause of an error
25
25
26
-
Using errors.Wrap constructs a stack of errors, adding context to the preceding error. Depending on the nature of the error it may be necessary to recurse the operation of errors.Wrap to retrieve the original error for inspection. Any error value which implements this interface
26
+
Using `errors.Wrap` constructs a stack of errors, adding context to the preceding error. Depending on the nature of the error it may be necessary to recurse the operation of errors.Wrap to retrieve the original error for inspection. Any error value which implements this interface can be inspected by `errors.Cause`.
27
27
```
28
28
type causer interface {
29
29
Cause() error
30
30
}
31
31
```
32
-
Can be inspected by errors.Cause which will recursively retrieve the topmost error which does nor implement causer, which is assumed to be the original cause. For example:
32
+
`errors.Cause` will recursively retrieve the topmost error which does nor implement causer, which is assumed to be the original cause. For example:
0 commit comments