mirror of
https://github.com/drakkan/sftpgo.git
synced 2024-11-25 09:00:27 +00:00
try to improve error message if the user forgot to initialize the provider
See #138
This commit is contained in:
parent
95fe26f3e3
commit
8fddb742df
1 changed files with 3 additions and 0 deletions
|
@ -774,6 +774,9 @@ func sqlCommonGetDatabaseVersion(dbHandle *sql.DB) (schemaVersion, error) {
|
|||
stmt, err := dbHandle.PrepareContext(ctx, q)
|
||||
if err != nil {
|
||||
providerLog(logger.LevelWarn, "error preparing database query %#v: %v", q, err)
|
||||
if strings.Contains(err.Error(), sqlTableSchemaVersion) {
|
||||
logger.WarnToConsole("database query error, did you forgot to run the \"initprovider\" command?")
|
||||
}
|
||||
return result, err
|
||||
}
|
||||
defer stmt.Close()
|
||||
|
|
Loading…
Reference in a new issue