As I see in your code you already do some "error handling". So you can continue:

Change your code

Do objExternalUser.%Save()

to the following:

set stat=objExternalUser.%Save()

if $$$ISERR(stat) {

 #; error handling

 d $System.OBJ.DisplayError(stat)

}

HTH.

Out of curiosity - you have empty Try-Catch block. Why don't use it?

you could embrace your code into the following:

$$$TOE(objExternalUser.%Save())

And catch your error with status in catch then.

Hi Salma!

If you import this file from this Open Exchange project it can do the export classes in folders:

Once imported call this to setup a folder:

USER>do ##class(dev.code).workdir("my/workdir/src")

Call this to export all classes, macro, deepsee resources in a given workdir.

USER> do ##class(dev.code).export()

You also can import the whole package too.

HTH