mirror of
https://github.com/Starlio-app/Starlio-web.git
synced 2024-11-22 08:36:22 +03:00
add error handler
This commit is contained in:
parent
f56f61ba18
commit
89a97fcac3
1 changed files with 7 additions and 3 deletions
|
@ -19,11 +19,15 @@ var SettingsGet = func(w http.ResponseWriter, r *http.Request) {
|
||||||
panic(errQuery)
|
panic(errQuery)
|
||||||
}
|
}
|
||||||
|
|
||||||
defer query.Close()
|
defer func(query *sql.Rows) {
|
||||||
|
err := query.Close()
|
||||||
|
if err != nil {
|
||||||
|
panic(err)
|
||||||
|
}
|
||||||
|
}(query)
|
||||||
|
|
||||||
var lang string
|
var lang string
|
||||||
var autostart int
|
var autostart, autoupdate int
|
||||||
var autoupdate int
|
|
||||||
|
|
||||||
for query.Next() {
|
for query.Next() {
|
||||||
err := query.Scan(&lang, &autostart, &autoupdate)
|
err := query.Scan(&lang, &autostart, &autoupdate)
|
||||||
|
|
Loading…
Add table
Reference in a new issue