Hi there Daniel!

We're slamming up against this issue right now too. Just wondering if there 
is any chance of a possible fix somewhere in the pipeline in the near 
future (or even at all)? 

It would be so awesome to be able to immediately catch the 403 - rather 
than having to wait for the Query timeout...



On Wednesday, 18 February 2015 02:15:10 UTC+11, Daniel LaLiberte wrote:
>
> Hi Jean-Rémi
>
> It appears the api must have handled this access_denied error at some time 
> in the past, but at this time, it is not, perhaps due to changes on the 
> spreadsheet side.  We will investigate whether we can fix this.  Thanks for 
> your  report.
>
> On Mon, Feb 16, 2015 at 10:09 AM, Jean-Rémi Delteil <jeanremi...@gmail.com 
> <javascript:>> wrote:
>
>> Hello,
>>
>> The following spreadsheet 
>> <https://docs.google.com/spreadsheets/d/1ddmng6RKNaHcxX_s5jLXEKhd3lOXRuXmOPbXsWZRpE8/edit>
>>  
>> is not public, so the query.send() request will throw an error 403 in the 
>> browser console.
>> But this error is not reported in the callback response parameter.
>>
>> With a small script (at the end of this post), I get the following 
>> console log :
>>
>> *15:40:11.321  * 
>>> https://docs.google.com/a/revevol.eu/spreadsheets/d/1ddmng6RKNaHcxX_s5jLXEKhd3lOXRuXmOPbXsWZRpE8/gviz/tq?headers=2&range=A1:H&sheet=Sheet1&tqx=reqId:0
>>>   
>>> Failed to load resource: the server responded with a status of 403 (OK)
>>> *15:40:41.000  * test.html:21  Query DATA fetch: 30006.907ms
>>> *15:40:**41.000   *test.html:23  isError : true
>>> *15:40:**41.007*   test.html:24  hasWarning : false
>>> *15:40:**41.008*   test.html:25  getReasons : timeout
>>> *15:40:**41.008*   test.html:26  getMessage : Request timed out
>>> *15:40:**41.008*   test.html:27  getDetailedMessage :
>>
>>
>> The documentation 
>> <https://developers.google.com/chart/interactive/docs/reference#QueryResponse>
>>  says 
>> that getReasons() can return the followings code :
>> - access_denied The user does not have permissions to access the data 
>> source.
>> - invalid_query The specified query has a syntax error.
>> - data_truncated One or more data rows that match the query selection 
>> were not returned due to output size limits. (warning).
>> - timeout The query did not respond within the expected time.
>>
>> Here, in this case, we should get an access_denied message.
>> It's either a problem in the google spreadsheet visualization 
>> implementation, either the mechanism behind *query.send()* in 
>> visualization.
>>
>> As you can see in the* time-stamps*, the error 403 got thrown just after 
>> the query, but* query.send()* wait until the timeout (30 sec by default) 
>> to kick back.
>> This problem now impacts Awesome Table 
>> <https://sites.google.com/site/scriptsexamples/available-web-apps/awesome-tables>,
>>  
>> where it is necessary to get the correct reason of failure to inform the 
>> users.
>>
>> Thank you for your time,
>>
>> Jean-Rémi Delteil, Awesome Table Team
>>
>>
>> ps : here is the script :
>>
>> <!DOCTYPE html>
>> <html>
>> <head>
>> <script type="text/javascript" src="
>> https://www.google.com/jsapi?autoload={'modules':[{'name':'visualization', 
>> 'version':'1','packages':['controls']}]}"></script>
>> </head>
>> <body>
>> <script>
>> google.setOnLoadCallback(sendQuery);
>> function sendQuery(){
>> var queryString = '
>> https://docs.google.com/spreadsheets/d/1ddmng6RKNaHcxX_s5jLXEKhd3lOXRuXmOPbXsWZRpE8/gviz/tq?headers=2&range=A1:H&sheet=Sheet1
>> ';
>> var query = new google.visualization.Query(queryString);
>> // send the query
>> console.time('Query DATA fetch');
>> query.send(handleQueryResponse);
>> }
>> function handleQueryResponse(response) {
>> console.timeEnd('Query DATA fetch');
>>
>> console.log('isError : ' + response.isError());
>> console.log('hasWarning : ' + response.hasWarning());
>> console.log('getReasons : ' + response.getReasons());
>> console.log('getMessage : ' + response.getMessage());
>> console.log('getDetailedMessage : ' + response.getDetailedMessage());
>> }
>> </script>
>> </body>
>> </html>
>>
>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Google Visualization API" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to google-visualization-api+unsubscr...@googlegroups.com 
>> <javascript:>.
>> To post to this group, send email to google-visua...@googlegroups.com 
>> <javascript:>.
>> Visit this group at 
>> http://groups.google.com/group/google-visualization-api.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>
>
> -- 
> Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> 
>  - 978-394-1058
> dlali...@google.com <javascript:>   5CC, Cambridge MA
> daniel.l...@gmail.com <javascript:> 9 Juniper Ridge Road, Acton MA
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Visualization API" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-visualization-api+unsubscr...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/1f0697f3-e711-4daa-bc27-ec5411958497%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to