The print method does not return any values. It will throw an exception,
though, if the print process is not successful, but that's probably not
happening in your case.
There is no exception thrown in this case, I have placed the code within the try block only.
Well, if you put it in a try-block then if there is an exception thrown then it will be caught... What did you do in the catch-block?
There is a pop-up with in the catch block with the error message.
var pri = this.print(pp);