From 7aace273559c7694ccccf951b69c83c1b939ff26 Mon Sep 17 00:00:00 2001 From: Rayner De Los Santos F Date: Wed, 3 Jan 2018 09:04:10 -0400 Subject: [PATCH] Adding hasError method (#45) --- karax/errors.nim | 2 ++ 1 file changed, 2 insertions(+) diff --git a/karax/errors.nim b/karax/errors.nim index 847bd85..aedd103 100644 --- a/karax/errors.nim +++ b/karax/errors.nim @@ -8,6 +8,8 @@ var proc hasErrors*(): bool = gerrorCounter != 0 +proc hasError*(field: cstring): bool = gerrorMsgs.contains(field) and len(gerrorMsgs[field]) > 0 + proc disableOnError*(): cstring = toDisabled(hasErrors()) proc getError*(field: cstring): cstring =