From 126c4f1c7c76959ba28165ee5f59055a5b0fd452 Mon Sep 17 00:00:00 2001 From: Jonathan Bernard Date: Thu, 2 Jan 2020 18:42:48 -0600 Subject: [PATCH] Make record not found error messages more descriptive. --- src/fiber_orm.nim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/fiber_orm.nim b/src/fiber_orm.nim index 79dacd1..6abcf88 100644 --- a/src/fiber_orm.nim +++ b/src/fiber_orm.nim @@ -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)