I'm using a calendar which syncs both automatically and under request (if designated by user) with G!Calendar. All works fine, except that I need to check if the calendar ID provided by the user exists.
For this I'm using:
$cal = "GOOGLE CALENDAR ID";
$service = new Google_Service_Calendar($client);
$title = $service->calendars->get($cal);
If the ID exists, the script runs fine. If it doesn't, then the page craches. How can I get the error JSON string it was supposed to return (as specified at the API resource page), so I can warn the user and block those errors from propagating?
Thanks in advance.