diff --git a/README.md b/README.md index 9441802..6095c64 100644 --- a/README.md +++ b/README.md @@ -80,3 +80,13 @@ if errors.Is(err, &pgx.ErrNoRows) { return &alayer.Err1.Wrap(err) } ``` + +## Type assertion +All generated errors implement `blunder.OrdinaryError` interface, which contains static methods. + +```go +ordinaryError, ok := err.(blunder.OrdinaryError) +if ok { + fmt.Println(ordinaryError.GetId()) +} +```