From b0e3c38b8a85091044faa40e3ce223bb8159c839 Mon Sep 17 00:00:00 2001 From: Ivan Folgueira Bande Date: Thu, 29 Feb 2024 15:05:06 +0100 Subject: [PATCH] testlib/postgres.nim: simplify error handling --- tests/testlib/postgres.nim | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/testlib/postgres.nim b/tests/testlib/postgres.nim index 6d3c733a0f..c1b073f91b 100644 --- a/tests/testlib/postgres.nim +++ b/tests/testlib/postgres.nim @@ -12,9 +12,6 @@ const storeMessageDbUrl = "postgres://postgres:test123@localhost:5432/postgres" proc newTestPostgresDriver*(): Future[Result[ArchiveDriver, string]] {.async.} = - proc onErr(errMsg: string) {.gcsafe, closure.} = - quit(QuitFailure) - let vacuum = false migrate = true @@ -26,7 +23,8 @@ proc newTestPostgresDriver*(): Future[Result[ArchiveDriver, string]] {.async.} = maxNumConn, onErr) if driverRes.isErr(): - onErr("could not create archive driver: " & driverRes.error) + error("could not create archive driver: " & driverRes.error) + quit(QuitFailure) return ok(driverRes.get())