I'm still confused.  The error comes back with status=401L.
I know 401 is an http status, but the "L" throws me off.  What does
the "L" mean on the 401L?
I didn't see that on the pages you referred to me.

Like I said, I specifically "unshared" the file to see what error I
would get.
As a developer, I need to handle the most likely types of errors, but
I need to know what kind of errors are going to be common and
reasonable.

I can write a lookup routine that converts '401' to "not authorized"
or I can show the error/body that you send to me which says "Sorry,
that action is not allowed" and the reason is blank.  In this case, I
think "not authorized" or "user xxxxxx is not authorized to read file
yyyyy" would be a more clear message for my users.  "Sorry, that
action is not allowed" is way to general and vague.


Thanks,
Neal


On Aug 4, 9:48 pm, Eric Bidelman <api.e...@google.com> wrote:
> Hi Neal,
> Some standard errors come to all of the Data APIs are listed 
> here:http://code.google.com/apis/gdata/docs/2.0/reference.html#HTTPStatusC...
>
> <http://code.google.com/apis/gdata/docs/2.0/reference.html#HTTPStatusC...>Of
> course, each API may have slightly different errors specific
> to that service.  In general, you can follow the above list, but I wouldn't
> recommend displaying the error message directly.  For example,
> you can assume a 401 is related to an authentication issue.
> In your example, it's b/c the user doesn't have access to that
> document.
>
> Eric
>
> On Tue, Aug 4, 2009 at 6:17 PM, NealWalters 
> <nealwalt...@nealwalters.com>wrote:
>
>
>
> > I purposely caused this error by removing a user from the document,
> > and trying to get it's feed by docid:
>
> > {'status': 401L, 'body': 'Sorry, that action is not allowed',
> > 'reason': ''}
>
> > I'm looking for where these erros are documented.  The reason above
> > seems to be blank, this is not an error that a user would understand,
> > so I'm tasked with interpreting the errors for the user.
>
> > Is there a page in the doc that says what a 401L is, and what other
> > errors I might possibly get?
>
> > I'm running under GAE, here's my code.  I've got a timeout once or
> > twice, so I'm trying to retry for timeouts, but give a more friendly
> > message for other type of errors.
>
> > def GetGoogleDocHTMLContents(argClient, argDocId):
> >   """
> >   Given a docId, and an already authorized client,
> >   grab the HTML contents of a file on google docs
> >   """
> >   exportFormat = "html"
> >   domain = "docs.google.com"
> >   url = "http://"; + domain + "/feeds/download/documents/Export?
> > docID=" + argDocId + "&exportFormat=" + exportFormat
>
> >   #TODO - how to test this - also might want retry on other feeds and
> > client.login
> >   retries = 0
> >   htmlFileContents = ""
> >   err = "time"  #short for timeout
> >   while retries < 5 and "time" in err.lower():
> >      try:
> >         htmlFileContents = argClient.Get(url,converter=str)
> >         retries = 9999 #we got the file, quit the loop
> >      except (Exception), err:
> >         #TODO specifically look for timeout here, not just any error
> >         retries += 1
> >         htmlFileContents = str(err)
> >         import logging
> >         logging.debug("GetGoogleDocHTMLContents:" + str(err))
>
> >   return htmlFileContents
>
> > Thanks,
> > Neal Walters
>
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Docs Data APIs" group.
To post to this group, send email to Google-Docs-Data-APIs@googlegroups.com
To unsubscribe from this group, send email to 
google-docs-data-apis+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/Google-Docs-Data-APIs?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to