forked from cerc-io/ipld-eth-server
Log error on failure to setup plugin migrations
- include specific error
This commit is contained in:
parent
62cca62432
commit
0558792282
@ -77,13 +77,15 @@ func (m *manager) setupMigrationEnv() error {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
err = os.RemoveAll(m.tmpMigDir)
|
removeErr := os.RemoveAll(m.tmpMigDir)
|
||||||
if err != nil {
|
if removeErr != nil {
|
||||||
return errors.New(fmt.Sprintf("unable to remove file found at %s where tmp directory needs to be written", m.tmpMigDir))
|
removeErrString := "unable to remove file found at %s where tmp directory needs to be written: %s"
|
||||||
|
return errors.New(fmt.Sprintf(removeErrString, m.tmpMigDir, removeErr.Error()))
|
||||||
}
|
}
|
||||||
err = os.Mkdir(m.tmpMigDir, os.FileMode(os.ModePerm))
|
mkdirErr := os.Mkdir(m.tmpMigDir, os.FileMode(os.ModePerm))
|
||||||
if err != nil {
|
if mkdirErr != nil {
|
||||||
return errors.New(fmt.Sprintf("unable to create temporary migration directory %s", m.tmpMigDir))
|
mkdirErrString := "unable to create temporary migration directory %s: %s"
|
||||||
|
return errors.New(fmt.Sprintf(mkdirErrString, m.tmpMigDir, mkdirErr.Error()))
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user