Question Anna Golitsyna · Jul 9, 2025

How to set up a "silent" error?

I like Application Error Log a lot, both for its full stack and a big list of variables. I'd like to "hack" this functionality and record the same in this log when a certain variable has a certain value. This quasi error should not be visible to the user, and it should not interrupt the application flow. Is that possible?

Throwing an error in a try-catch block does not record the error, tested. I am considering recording variables and the stack differently, I know how to do both, but that would miss the nice Application Error Log functionality.

Upd: I got an immediate DC AI Bot reply. Offhand seems reasonable :-)

Product version: Caché 2017.1

Comments

Anna Golitsyna  Jul 9, 2025 to Alexey Maslov

Looks slightly unusual but fully functional. Thanks!

0
David Hockenbroch · Jul 9, 2025

You can log the exception in your catch block for exactly the result you're looking for, if I understand your request correctly.

try{
    //Your code here.
}
catch ex{
    //The below line will add the exception to the application error log.//Code will continue to execute after the catch block.do ex.Log()
}
0
Anna Golitsyna  Jul 9, 2025 to David Hockenbroch

Very good and customizable
TRY {
ex= ##class(%Exception.General).%New("test",1,data1,data2)
throw ex}
CATCH ex {
ex.Log()
}

0
Yaron Munz · Jul 10, 2025

You can call directly to: Do BACK^%ETN it will save the $ZE + the stack. (LOG is also calling this one)

0