Skip to content

Commit 5646534

Browse files
authored
Update README.md
1 parent 338a228 commit 5646534

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ And this, frankly, may be quite enough. With a set of standard error types provi
7474

7575
If an error requires special treatment, it may be done like this:
7676
```go
77-
// MyError = MyNamespace.NewType("my_error")
77+
// MyError = MyErrors.NewType("my_error")
7878
if errorx.IsOfType(err, MyError) {
7979
// handle
8080
}
@@ -84,8 +84,8 @@ Note that it is never a good idea to inspect a message of an error. Type check,
8484

8585
An alternative is a mechanisms called **traits**:
8686
```go
87-
// thie first parameter is a name of new error type, the second is a reference to existing declared trait
88-
TimeoutElapsed = CommonErrors.NewType("timeout", Timeout())
87+
// thie first parameter is a name of new error type, the second is a reference to existing trait
88+
TimeoutElapsed = MyErrors.NewType("timeout", errorx.Timeout())
8989
```
9090

9191
Here, ```TimeoutElapsed``` error type is created with a Timeout() trait, and errors may be checked against it:

0 commit comments

Comments
 (0)