Found one option!

ClassMethod DivideByZeroPython() [ Language = python ]

{

import sample

import iris

try:

print("divide by zero=" + str(sample.dividezero(1)))

except ZeroDivisionError as e:

errobj=iris.cls("%Exception.General")._New(str(e),42)

a=errobj.Log()

print("Caught exception: " + str(e))

}

This stores the error in Apps Log, but no stack (of course):

Any ideas how I can store at least the class and line of code in parameters? I can provide the name and location to %Exception.General class that will be stored in the App Log.

Yes. 

It maybe a different thing: the format with <Export generator> is outdated and Studio together with LoadDir both support the outdated format and don't support the "new" one without the <Export> element, which is in Atelier API that VSCode is using (why do we still use this Atelier name? )

So, I'd better ask to support the new format, as the Export tag thing also has an annoying "feature" that it incudes date/time of export and this changes the file with every save/export even there were no changes.