From 3dc81826fd290f694ed9247c893bae08921e658d Mon Sep 17 00:00:00 2001 From: Peter Dotchev Date: Fri, 30 Aug 2019 06:09:02 +0300 Subject: [PATCH] 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 --- migrate.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/migrate.go b/migrate.go index f692d6f9e..1478bc2a0 100644 --- a/migrate.go +++ b/migrate.go @@ -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 }