feat: inc generic metric if error occurs #161
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"log/slog"
|
||||
"me-fit/template"
|
||||
"me-fit/template/workout"
|
||||
"me-fit/utils"
|
||||
@@ -66,7 +65,7 @@ func HandleWorkoutNewComp(db *sql.DB) http.HandlerFunc {
|
||||
var rowId int
|
||||
err = db.QueryRow("INSERT INTO workout (user_id, date, type, sets, reps) VALUES (?, ?, ?, ?, ?) RETURNING rowid", user.Id, date, typeStr, sets, reps).Scan(&rowId)
|
||||
if err != nil {
|
||||
slog.Error(err.Error())
|
||||
utils.LogError("Could not insert workout", err)
|
||||
http.Error(w, err.Error(), http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user