Hello.
If you want to do what you want then just modify the return type of checkIfURLExists() to String rather than boolean.
In the catch block, write return "";
In the try block, write...