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