# HG changeset patch # User Tom Gottfried # Date 1585308048 -3600 # Node ID 7bd9c5161836389c1bda5d48bc38e205d53f2ebc # Parent 2dcfab23dc86d1c469a4dee7371ca430e3fd3449 Handle deletion of non-existent sounding results gracefully diff -r 2dcfab23dc86 -r 7bd9c5161836 pkg/imports/dsr.go --- a/pkg/imports/dsr.go Fri Mar 27 10:33:39 2020 +0100 +++ b/pkg/imports/dsr.go Fri Mar 27 12:20:48 2020 +0100 @@ -112,8 +112,13 @@ dsr.BottleneckID, dsr.Date.Time) var id int64 - if err := tx.QueryRowContext(ctx, dsrFindSQL, - dsr.BottleneckID, dsr.Date.Time).Scan(&id); err != nil { + switch err := tx.QueryRowContext(ctx, dsrFindSQL, + dsr.BottleneckID, dsr.Date.Time).Scan(&id); err { + case sql.ErrNoRows: + return nil, UnchangedError("Sounding result does not exist") + case nil: + // Continue + default: return nil, err }