Home Applications iris-watched-status

iris-watched-status

InterSystems does not provide technical support for this project. Please contact its developer for the technical assistance.
0
0 reviews
0
Awards
4
Views
0
IPM installs
0
0
Details
Releases (4)
Reviews
Issues
Status that automatically detects and handles errors.

What's new in this version

Publishing of 1.0.2 failed, trying 1.0.3.

iris-watched-status

This class allows the user to create a class containing a %Library.Status object. Depending on how the properties of the class are set, the status can throw or log itself as an exception or write out its error text automatically whenever the status goes from $$$OK to an error status.

Instances should be created by calling the New method and providing flags as desired. Available flags are:

  • T - The status will be thrown when it is an error.
  • L - The status will be logged as an exception when it becomes an error.
  • W - The status will write its error text when it becomes an error.
  • R - The status will reset to $$$OK after all other error handling.

Flags can be provided in any order and are not case sensitive.

The following code should create a watched status that writes its own error text, then resets to $$$OK. (This is useful when testing in a terminal.)

set status = ##class(DH.WatchedStatus).New(“RW”)

set status.sc = (some method that returns a status object)

If the R flag was not given, further error handing by setting this same status will not trigger unless the sc is manually set back to $$$OK.

Made with
Install
zpm install watchedstatus download archive
Version
1.0.305 Mar, 2025
Category
Solutions
Works with
InterSystems IRISInterSystems IRIS for HealthHealthShareTrakCareCachéEnsemble
First published
05 Mar, 2025
Last edited
05 Mar, 2025