antonlindstrom/pgstore

Fix the errors returned by the "createSessionsTable" function

GrimAnEye opened this issue · 0 comments

There was already a problem number #35 , where there was a problem of creating a table in the database.
The problem may be that the function does not return driver data, but changes it to its own insufficiently informative.
For example, the http_session table is not created for me, but why it was not created, I found out only in debug mode, reaching the output of the driver error:

func (db *PGStore) createSessionsTable() error {
...
_, err := db.DbPool.Exec(stmt)
if err!=nil{
// My error was: "pq: SSL is not enabled on the server"
// but I won't know about it because "Unable to create http_sessions table in the database"
return errors.Wrapf(err, "Unable to create http_sessions table in the database")
}
}

Мaybe it is worth concatenating errors or outputting driver errors?