Article
· 11 hr ago 1m read

How Do You Display %Status Error in Terminal Or Let's Have a New Helpful Terminal Alias!

Hi colleagues!

Yet another time I figured that there is no super-simple way to display error from %Status variable, but I need it relatively often in a terminal.

Yes, I know about $$$ Macro, but they are not superhelpful in a terminal.

My usual behavior is to try to remember by heart or copy from somewhere the formula:

USER>w $System.Status.DisplayError(st)

So introduced the alias:

:alias err d $System.Status.DisplayError($1) ;

so, if you get something like:

USER>set st=##class(bla.bla).methodbla()

you can get the error as:

USER>:err st
d $System.Status.DisplayError(st) ;

ERROR #879: Target role NewRole does not exist.

Hope you like it!

All aliases

Discussion (3)1
Log in or sign up to continue