This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DSS exception processing / printing problem

Hi

I have a simple DSS script to download the contents of some variables and store them in text files.  If the user specifies an invalid symbol I want to catch an exception, print a warning and then continue the script.

With no try-catch block I have:

var address = debugSession.symbol.getAddress( symbols[i].name );

and a bad symbol name gives:

Unable to get address for symbol: SwiftLoggerObjx (<script path>memoryDump.js#82)

So I added a try-catch block:

    try
    {
        var address = debugSession.symbol.getAddress( symbols[i].name );
    }
    catch( exception )
    {
        System.out.println( exception.javaException.getMessage() )
    }

but then I see nothing in the exception case.

Do I need to import something in order to use System.out.println ?

I already have:

importPackage(Packages.java.lang)
importPackage(Packages.java.io)

Best regards

David