mirror of https://gitee.com/answerdev/answer.git
Merge branch 'ai_0.3_install_api' into 'test'
feat: modify the error information about the failure to create a table See merge request opensource/answer!226
This commit is contained in:
commit
25763d20ff
|
@ -97,6 +97,8 @@ backend:
|
|||
database:
|
||||
connection_failed:
|
||||
other: "Database connection failed"
|
||||
create_table_failed:
|
||||
other: "Create table failed"
|
||||
install:
|
||||
create_config_failed:
|
||||
other: "Can’t create the config.yaml file."
|
||||
|
|
|
@ -40,6 +40,7 @@ const (
|
|||
ReportNotFound = "error.report.not_found"
|
||||
ReadConfigFailed = "error.config.read_config_failed"
|
||||
DatabaseConnectionFailed = "error.database.connection_failed"
|
||||
InstallCreateTableFailed = "error.database.create_table_failed"
|
||||
InstallConfigFailed = "error.install.create_config_failed"
|
||||
SiteInfoNotFound = "error.site_info.not_found"
|
||||
)
|
||||
|
|
|
@ -170,7 +170,7 @@ func InitBaseInfo(ctx *gin.Context) {
|
|||
|
||||
if err := migrations.InitDB(c.Data.Database); err != nil {
|
||||
log.Error("init database error: ", err.Error())
|
||||
handler.HandleResponse(ctx, errors.BadRequest(reason.DatabaseConnectionFailed), schema.ErrTypeAlert)
|
||||
handler.HandleResponse(ctx, errors.BadRequest(reason.InstallCreateTableFailed), schema.ErrTypeAlert)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue