From 8dc20f424248f28f67f477887c29a5571e71b1f0 Mon Sep 17 00:00:00 2001 From: Fraser Greenroyd Date: Tue, 27 Feb 2024 11:21:58 +0000 Subject: [PATCH] Update Handling-Exceptional-Events.md --- .../Best-practices/Handling-Exceptional-Events.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/Guides-and-Tutorials/Coding-with-BHoM/Best-practices/Handling-Exceptional-Events.md b/docs/Guides-and-Tutorials/Coding-with-BHoM/Best-practices/Handling-Exceptional-Events.md index fda2b624..09a0ebe9 100644 --- a/docs/Guides-and-Tutorials/Coding-with-BHoM/Best-practices/Handling-Exceptional-Events.md +++ b/docs/Guides-and-Tutorials/Coding-with-BHoM/Best-practices/Handling-Exceptional-Events.md @@ -192,11 +192,11 @@ If your method ends up in a situation where it could not return any meaningful o ### Log errors as exceptions -You can also opt to catch BHoM Error Events as Exceptions if you so wish. By default, errors are just logged in the Log and not handled any further. However, you can call `BH.Engine.Base.Compute.ThrowError(false)` which will turn off the suppression of exception throwing. +You can also opt to catch BHoM Error Events as Exceptions if you so wish. By default, errors are just logged in the Log and not handled any further. However, you can call `BH.Engine.Base.Compute.ThrowErrorsAsExceptions(true)` which will turn off the suppression of exception throwing. If you choose to do this, any error recorded into the Log while this suppression is off will be thrown as an exception itself, which you can then catch in a `try/catch` statement. -If you want to turn the suppression back on after your use, you can call `BH.Engine.Base.Compute.ThrowError(true)` and this will revert the Log to work in the default manner. +If you want to turn the suppression back on after your use, you can call `BH.Engine.Base.Compute.ThrowErrorsAsExceptions(false)` and this will revert the Log to work in the default manner. ## Good Log Messages @@ -296,4 +296,4 @@ If you want to retrieve events raised during the suppressed time period, you can The suppressed log will be reset once its events have been retrieved, so you don't need to worry about retrieving duplicates. -Retrieved events won't appear on the UI on components though, so users may still not know about them initially, but they can be queried using the same access components above in any of the BHoM supported UIs. \ No newline at end of file +Retrieved events won't appear on the UI on components though, so users may still not know about them initially, but they can be queried using the same access components above in any of the BHoM supported UIs.