webtry: Improve error handling/message when creating sqlite tables.

In case they fail, lets fail with an ERROR message rather than an INFO,
and lets make the error message a little bit better.

BUG=None
TEST=None
R=jcgregorio@google.com

Review URL: https://codereview.chromium.org/669643004
This commit is contained in:
tfarina 2014-10-22 11:57:36 -07:00 committed by Commit bot
parent 727b8c1d1c
commit 7a2df0c672

View File

@ -235,7 +235,7 @@ func Init() {
)`
_, err = db.Exec(sql)
if err != nil {
glog.Infof("status creating sqlite table for sources: %q\n", err)
glog.Errorf("Creating source_images table failed: %s", err)
}
sql = `CREATE TABLE IF NOT EXISTS webtry (
@ -251,7 +251,7 @@ func Init() {
)`
_, err = db.Exec(sql)
if err != nil {
glog.Infof("status creating sqlite table for webtry: %q\n", err)
glog.Errorf("Creating webtry table failed: %s", err)
}
sql = `CREATE TABLE IF NOT EXISTS workspace (
@ -261,7 +261,7 @@ func Init() {
)`
_, err = db.Exec(sql)
if err != nil {
glog.Infof("status creating sqlite table for workspace: %q\n", err)
glog.Errorf("Creating workspace table failed: %s", err)
}
sql = `CREATE TABLE IF NOT EXISTS workspacetry (
@ -278,7 +278,7 @@ func Init() {
)`
_, err = db.Exec(sql)
if err != nil {
glog.Infof("status creating sqlite table for workspace try: %q\n", err)
glog.Errorf("Creating workspacetry table failed: %s", err)
}
}