From e66cd2439b56854aa52562b177915c5716055394 Mon Sep 17 00:00:00 2001 From: Mark Spanbroek Date: Mon, 12 Apr 2021 16:05:31 +0200 Subject: [PATCH] Remove errorban from public api Reason: pushing pragmas in included files can have unexpected side-effects. --- Readme.md | 14 -------------- questionable/errorban.nim | 2 ++ 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/Readme.md b/Readme.md index 52e8db4..d031518 100644 --- a/Readme.md +++ b/Readme.md @@ -189,20 +189,6 @@ Any Result can be converted to an Option: let converted = works().option # equals @[1, 1, 2, 2, 2].some ``` -Banning Errors --------------- - -Should you decide to use Options and Results instead of the standard exception -handling in Nim, you may want to check that your procs are not accidently -raising errors. You can use the following include for this: - -```nim -include questionable/errorban -``` - -Proc definitions below the error ban are checked by the compiler to ensure that -they do not raise errors. - [1]: https://nim-lang.org/docs/options.html [2]: https://github.com/arnetheduck/nim-result [3]: https://github.com/nim-lang/nimble diff --git a/questionable/errorban.nim b/questionable/errorban.nim index d2becfc..9e2ec2b 100644 --- a/questionable/errorban.nim +++ b/questionable/errorban.nim @@ -1,3 +1,5 @@ +{.warning: "errorban is deprecated; use nimble package `upraises` instead".} + ## Include this file to indicate that your module does not raise Errors. ## Disables compiler hints about unused declarations in Nim < 1.4.0