Skip to content

Commit 3dc8182

Browse files
dotchevdhui
authored andcommitted
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
1 parent b6df2ca commit 3dc8182

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

migrate.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,12 @@ package migrate
77
import (
88
"errors"
99
"fmt"
10-
"github.com/hashicorp/go-multierror"
1110
"os"
1211
"sync"
1312
"time"
1413

14+
"github.com/hashicorp/go-multierror"
15+
1516
"github.com/golang-migrate/migrate/v4/database"
1617
iurl "github.com/golang-migrate/migrate/v4/internal/url"
1718
"github.com/golang-migrate/migrate/v4/source"
@@ -805,6 +806,7 @@ func (m *Migrate) versionExists(version uint) (result error) {
805806
return err
806807
}
807808

809+
m.logErr(fmt.Errorf("no migration found for version %d", version))
808810
return os.ErrNotExist
809811
}
810812

0 commit comments

Comments
 (0)