# HG changeset patch # User Sascha L. Teichmann # Date 1659694926 -7200 # Node ID bbc257dd9abf1388531746e6e503fa2a4b9dee43 # Parent 2b6c235e33b090910acd094eb6ce48709ac90bae Mixed bad error handling found by staticcheck. diff -r 2b6c235e33b0 -r bbc257dd9abf pkg/controllers/report.go --- a/pkg/controllers/report.go Fri Aug 05 12:14:44 2022 +0200 +++ b/pkg/controllers/report.go Fri Aug 05 12:22:06 2022 +0200 @@ -159,6 +159,11 @@ conn := middleware.GetDBConn(req) tx, err := conn.BeginTx(ctx, &sql.TxOptions{ReadOnly: true}) + if err != nil { + http.Error(rw, "Error: "+err.Error(), http.StatusInternalServerError) + log.Errorf("%v\n", err) + return + } defer tx.Rollback() if err := action.Execute(ctx, tx, template); err != nil { diff -r 2b6c235e33b0 -r bbc257dd9abf pkg/imports/sr.go --- a/pkg/imports/sr.go Fri Aug 05 12:14:44 2022 +0200 +++ b/pkg/imports/sr.go Fri Aug 05 12:22:06 2022 +0200 @@ -741,8 +741,9 @@ } if m.SurveyType != models.SurveyTypeMarking { + var index []byte - index, err := final.Bytes() + index, err = final.Bytes() if err != nil { return nil, err }