[MM-31398] upgrade error level to critical in case of panic or os.Exit (#16584)

* upgrade error level to critical in case of panic or os.Exit

* reflect revivew comments

* fix error capitalization
This commit is contained in:
Ibrahim Serdar Acikgoz
2020-12-23 13:11:35 +03:00
committed by GitHub
parent 8ca880d1cc
commit 8036ba86e7
6 changed files with 3 additions and 115 deletions

View File

@@ -20,6 +20,7 @@ import (
"github.com/mattermost/mattermost-server/v5/store/sqlstore"
"github.com/mattermost/mattermost-server/v5/store/storetest"
"github.com/mattermost/mattermost-server/v5/utils"
"github.com/pkg/errors"
)
type MainHelper struct {
@@ -169,8 +170,7 @@ func (h *MainHelper) PreloadMigrations() {
handle := h.SQLStore.GetMaster()
_, err = handle.Exec(string(buf))
if err != nil {
mlog.Error("Error preloading migrations. Check if you have &multiStatements=true in your DSN if you are using MySQL. Or perhaps the schema changed? If yes, then update the warmup files accordingly.")
panic(err)
panic(errors.Wrap(err, "Error preloading migrations. Check if you have &multiStatements=true in your DSN if you are using MySQL. Or perhaps the schema changed? If yes, then update the warmup files accordingly"))
}
}