Make record not found error messages more descriptive.
This commit is contained in:
parent
56a257be2e
commit
126c4f1c7c
@ -50,8 +50,8 @@ template getRecord*(db: DbConn, modelType: type, id: typed): untyped =
|
||||
" FROM " & tableName(modelType) &
|
||||
" WHERE id = ?"), @[$id])
|
||||
|
||||
if row.allIt(it.len == 0):
|
||||
raise newException(NotFoundError, "no record for id " & $id)
|
||||
if allIt(row, it.len == 0):
|
||||
raise newException(NotFoundError, "no " & modelName(modelType) & " record for id " & $id)
|
||||
|
||||
rowToModel(modelType, row)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user