I've a problem with FB.api
I'm making a call to create an event something along the lines of:
FB.api('/me/events', 'post', {
access_token: $('#access_token').attr('value'),
name: td.find('#event_name').attr('value'),
description: td.find('#description').attr('value'),
start_time: td.find('#event_start').attr('value'),
end_time: td.find('#event_end').attr('value'),
street: td.find('#venue_street').attr('value'),
city: td.find('#venue_city').attr('value'),
country: td.find('#venue_country').attr('value')
}, function(response){
console.log(response);
});
It works fine until e.g. 'city' is a non-existant city; then the callback function never gets called.
If I examine the AJAX request made using the net panel of firebug, I see the following was the response:
FB.ApiServer._callbacks.f37cab142051f02({
"error": {
"type": "Exception",
"message": "(#151) Unknown city"
}
});
The docs seem to show that I'm doing it right: http://developers.facebook.com/docs/reference/javascript/FB.api
Anyone why the callback function doesn't get called, and how I can catch the error?