Skip to content
Developerhome

noThrow

  Less than to read

By default, when your code encounters an error or exception, the catch handler is triggered. It executes its designated code and then proceeds to rethrow the error or exception. This ensures that the Sage 200 form framework also becomes aware of the error and performs its appropriate error handling procedures. Typically, this involves retaining the form’s content without clearing it and omitting the display of a ‘success’ message.

However, there may be specific scenarios where the developer intends to bypass the form’s error handling mechanism. In such cases, they can utilise the noThrow option to prevent the error from being rethrown. By employing this option, the form can seamlessly continue its execution on the success path, if the core form’s function itself did not encounter any errors.

In summary, the default behaviour is to catch and rethrow errors for the forms framework’s error handling, but developers have the flexibility to opt out of this behaviour using the “noThrow” option if desired.

"tryCatch": {
  "noThrow": [],
  "try": [
...    

It is important to note that the use of “noThrow” should be approached with care and consideration. Prior to implementing this option, it is essential to thoroughly test and validate your error handling approach to ensure it aligns with the requirements of your application and does not compromise the stability and functionality of the sreeen.