pgroll/pkg/state/errors.go
Andrew Farries 69ab631485
Add a sentinel error for no active migration (#11)
Add a sentinel error `ErrNoActiveMigration` for the case where there is
no active migration. This improves the error strings presented to users
by not mentioning SQL errors.

**`pg-roll start` when there is a migration in progess:**
```
Error: a migration for schema "public" is already in progress 
```

**`pg-roll rollback` when there is no migration in progress:**
```
Error: unable to get active migration: no active migration 
```

**`pg-complete` when there is no active migration:**
```
Error: unable to get active migration: no active migration
```
2023-07-03 14:18:31 +01:00

6 lines
93 B
Go

package state
import "errors"
var ErrNoActiveMigration = errors.New("no active migration")