Improve error message in case no migration is found (#158)

* Improve error message in case no migration is found

* Return similar error

* Just log the error

* Fix error message
This commit is contained in:
Peter Dotchev 2019-08-30 06:09:02 +03:00 committed by Dale Hui
parent b6df2cab18
commit 3dc81826fd
1 changed files with 3 additions and 1 deletions

View File

@ -7,11 +7,12 @@ package migrate
import ( import (
"errors" "errors"
"fmt" "fmt"
"github.com/hashicorp/go-multierror"
"os" "os"
"sync" "sync"
"time" "time"
"github.com/hashicorp/go-multierror"
"github.com/golang-migrate/migrate/v4/database" "github.com/golang-migrate/migrate/v4/database"
iurl "github.com/golang-migrate/migrate/v4/internal/url" iurl "github.com/golang-migrate/migrate/v4/internal/url"
"github.com/golang-migrate/migrate/v4/source" "github.com/golang-migrate/migrate/v4/source"
@ -805,6 +806,7 @@ func (m *Migrate) versionExists(version uint) (result error) {
return err return err
} }
m.logErr(fmt.Errorf("no migration found for version %d", version))
return os.ErrNotExist return os.ErrNotExist
} }