Pravin Barton · Mar 28, 2019 2m read
ObjectScript error handling snippets

ObjectScript has at least three ways of handling errors (status codes, exceptions, SQLCODE, etc.). Most of the system code uses statuses but exceptions are easier to handle for a number of reasons. Working with legacy code you spend some time translating between the different techniques. I use these snippets a lot for reference. Hopefully they're useful to others as well.

21 5
17 2,226
Timothy Leavitt · Jul 8, 2020 7m read
Tips for debugging with %Status


If you're solving complex problems in ObjectScript, you probably have a lot of code that works with %Status values. If you have interacted with persistent classes from an object perspective (%Save, %OpenId, etc.), you have almost certainly seen them. A %Status provides a wrapper around a localizable error message in InterSystems' platforms. An OK status ($$$OK) is just equal to 1, whereas a bad status ($$$ERROR(errorcode,arguments...)) is represented as a 0 followed by a space followed by a $ListBuild list with structured information about the error. $System.Status (see class reference) provides several handy APIs for working with %Status values; the class reference is helpful and I won't bother duplicating it here. There have been a few other useful articles/questions on the topic as well (see links at the end). My focus in this article will be on a few debugging tricks techniques rather than coding best practices (again, if you're looking for those, see links at the end).

14 7
10 1,245
Evgeny Shvarov · Aug 2, 2020 1m read
Application Errors Analytics

Hi Developers!

As you know the application errors live in ^ERRORS global. They appear there if you call:

d e.Log() 

in a Catch section of Try-Catch.

With @Robert Cemper's approach, you can now use SQL to examine it.

Inspired by Robert's module I introduced a simple IRIS Analytics module which shows these errors in a dashboard:

3 5
1 252
Istvan Hahn · Oct 6, 2016 4m read
RESTful Exception Handling

A beginner’s guide to Exception Handling in RESTful web services. The article gives an example how the various error conditions during processing a service request can be handled.

We expect our client – server communication working in a flawless operational condition, running error free software. But we are prepared to handle exceptions. Are we? So far in the examples of the previous sessions were not. We did not care about exceptions. The result? In any error incident it took ages to figure out what the problem is and more importantly how to fix it.

3 1
0 1,479
Evgeny Shvarov · Sep 28, 2020
%Status usage in ObjectScript

Hi developers!

Want to discuss with you the case of %Status.

If you familiar with ObjectScript you know what is it. I'd love to hear the history of the case why it had appeared in ObjectScript but it turned out that almost every system/library classmethods return %Status and there is a whole set of tools to deal with it.

What is does it gives you the responsibility to check the value or %Status of every system method you call.

E.g. if you save the data of the persistent class, you should never call like this:

do obj.%Save()

you need to call:

set sc=obj.%Save()

if $$$ISERR(sc) do // something or quit.

1 19
0 615

Hi Community,

I have created a HL7 production in my working environment, Ens.Alert ,EMailAlert, PagerAlert, and BadMessageHandler are created.

Can anyone explain how Ens.Alert and BadMessageHandler will work when an HL7 message in Passed in Business service and how these 2 are related when any error occurs in the Production envinorment?

0 1
0 58

Hello everybody,

In the documentation I read the following:

Alerts are messages generated by production components. InterSystems IRIS automatically writes the alerts to a log file and sends then to the production component named Ens.Alert. If your production does not have a component named Ens.Alert, then InterSystems IRIS writes alerts to the log file but does not send them to any component. The component named Ens.Alert can be of any class. The most frequently used classes for Ens.Alert are:

0 3
1 122
Smythe Smythee · Nov 14, 2022
SSL Configuration for Gmail

Hi Community,

I am configuring new SSL Configuration for Gmail (For sending errors to gmail in ensemble production) by following the below steps.


Step2:Giving the server address

Step3:Giving the port number , I have tried giving 465,587,25 as port number still is not connecting

Can anyone please tell me where i am doing wrong on configuration?



0 6
0 369


While HL7 Errors ACKs come back in the soap response, the HL7v2 Error ACK message is not processed.

I used the SOAP Wizard to construct my classes, but the generated code doesn't handle the HL7v2 ACK.
Does health Connect have a class that handles this?

Failing an official solution should I go ahead and make make my own classes based on EnsLib.HL7.Operation.TCPOperation, but wrapping it with the generated SOAP handling code.

How have others dealt with this?

0 1
0 283

Hi all,

I have a rule to throw a message when there is an error. I want to prevent send the email if the origin of the error is the API to send the email

This is my rule

Now, If there is any error in any process, it works, but if there is an error in MyProduct.BO.SendEmail it is trying to send the error again, and it is a infinite loop.

Is there any way to check what is the origin and don't process if the origin is MyProduct.BO.SendEmail?

0 2
0 199


I'm experiencing a recurrent problem that I haven't found the way to solve, so I'm coming here with the hope somebody can give me a new approach.

To make it short: we are creating categories on-demand to be able to place the maximum numbers of workers in memory, avoiding the limits established by system categories. But from time to time, one of this creation fails and system is no able to start the queue. The error we are getting is:

0 1
0 162

New to Health Connect so please forgive me if this is a stupid question! Is there a specific error code returned when a user initiates an abort from the jobs tab of the business host? I want to be able to treat the Abort as Completed due to our complex business process. Currently, hitting abort just retries the message to the same business operation. Want I want to do is provide the error code used by the Abort (if there is one) and treat it as OK

Thanks in advance.

0 4
0 231

Hey everyone as you may know I am a beginner and I am kindly asking for some assistance in a problem I have been solving. The problem is that I am calling a user defined function within a procedure called occupiedseatsAdj and the compiler comes up with this error.

0 2
0 105

I have some code in a mac routine that use indentation and the "." character :

 IF condition1 DO
     .WRITE YCR,...
     .WRITE YCR,...
     .WRITE YCR,...

I would like to add a try / catch block between the write statements.
I can't refactor the whole code and use indentation with curly braces instead (there is too much code, not written by me)

I have tried the following but it does not work (it compiles, but code stop running right before the try keyword)

0 2
0 167
fajie xie · Jan 27, 2021
License occupied 100% situation

许可证检测中,当前许可证使用达到100%,我们应该如何迅速处理解决它?并且不影响生产环境。 In license detection, the current license usage reaches 100%. How can we deal with it quickly? And does not affect the production environment.

0 5
0 181