Capturing Exception message

Viewed 31

How to capture exception when we try to encrypt the file through PGP tool.
Using below command to encrypt the file:

try
     {
        & $gpg_prog --yes -e -r $gpg_r -o $out_file $in_file
    }
 catch [Exception]
    {
    }

But this above code is not to able to capture the exception message.

What can be done for capturing the exception?

0 Answers
Related