The query.send() function doesn't throw exceptions. Instead, in your
response function (the one you pass to query.send), you should do:
if (response.isError()) {
alert(response.getMessage());
return;
}
dataTable = response.getDataTable();
I hope that helps.
On Thu, Jun 24, 2010 at 7:13 AM, lesfreeman <[email protected]>wrote:
> Hello,
> I'm trying to catch server errors and display a custom error message.
> Unfortunetly, I can't seem to catch the error on the JS side. Here's
> the short version of my code:
>
> try{
> var query = new google.visualization.Query("http://some-server.com/
> api");
> query.send(function(response){
> //some stuff gets done here
> });
> }catch(e){
> console.log(e.name+" "+e.message);
> }
>
> Unfortunately, the error does not get caught. I my JS console I get:
>
> Uncaught Error: google.visualization.Query: Internal Server Error
> [500]
>
> If I throw a custom error in the try block, it gets caught.
>
> Any ideas?
>
> Thanks
> Les
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google Visualization API" group.
> To post to this group, send email to
> [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-visualization-api%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-visualization-api?hl=en.
>
>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-visualization-api?hl=en.