[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
Этот коммит содержится в:
Ibrahim Serdar Acikgoz
2020-12-23 13:11:35 +03:00
коммит произвёл GitHub
родитель 8ca880d1cc
Коммит 8036ba86e7
6 изменённых файлов: 3 добавлений и 115 удалений

Просмотреть файл

@@ -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"))
}
}