I would wrap the try/catch around the whole method, from $urlQuery to the last line, so all kinds of errors are covered