mirror of https://github.com/perkeep/perkeep.git
camtool/dbinit: fix error printing
Change-Id: I749eae0207f5aa96bb342cf961d8511344acc26c
This commit is contained in:
parent
975e251c36
commit
98d967ce39
|
@ -188,7 +188,7 @@ func (c *dbinitCmd) RunCommand(args []string) error {
|
||||||
func do(db *sql.DB, sql string) {
|
func do(db *sql.DB, sql string) {
|
||||||
_, err := db.Exec(sql)
|
_, err := db.Exec(sql)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
exitf("Error %v running SQL: %s", err, sql)
|
exitf("Error %q running SQL: %q", err, sql)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ func doQuery(db *sql.DB, sql string) {
|
||||||
r.Close()
|
r.Close()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
exitf("Error %v running SQL: %s", err, sql)
|
exitf("Error %q running SQL: %q", err, sql)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *dbinitCmd) dbExists(db *sql.DB) bool {
|
func (c *dbinitCmd) dbExists(db *sql.DB) bool {
|
||||||
|
@ -249,7 +249,7 @@ func exitf(format string, args ...interface{}) {
|
||||||
if !strings.HasSuffix(format, "\n") {
|
if !strings.HasSuffix(format, "\n") {
|
||||||
format = format + "\n"
|
format = format + "\n"
|
||||||
}
|
}
|
||||||
cmdmain.Errorf(format, args)
|
cmdmain.Errorf(format, args...)
|
||||||
cmdmain.Exit(1)
|
cmdmain.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue