Skip to content

Commit

Permalink
Improve error message in case no migration is found (golang-migrate#158)
Browse files Browse the repository at this point in the history
* Improve error message in case no migration is found

* Return similar error

* Just log the error

* Fix error message
  • Loading branch information
dotchev authored and dhui committed Aug 30, 2019
1 parent b6df2ca commit 3dc8182
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion migrate.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
}

Expand Down

0 comments on commit 3dc8182

Please sign in to comment.