ah... the *tyranny of /w* this works... HTTP('429 Too_Many_Requests')
In glucon/http.py HTTP regex_status isn't friendly to messages with whitespace (or hyphens) Thanks for pointing me to this. One line simple line beats 5 simple lines! :) On 1 May 2013 16:41, Anthony <abasta...@gmail.com> wrote: > More simply, I think you can also just do this: > > raise HTTP('429 Too Many Requests') > > Anthony > > On Wednesday, May 1, 2013 11:33:14 AM UTC-4, Carl wrote: > >> works sweetly. >> >> from gluon import HTTP >> from gluon.http import defined_status >> if not(429 in defined_status): >> defined_status[429] = 'Too Many Requests' >> raise HTTP(429, "Too Many Requests") >> >> >> >> On Wednesday, 1 May 2013 15:57:36 UTC+1, Carl wrote: >> >>> thanks Leonel, I'm refactoring server calls at the mo, but I'll try that >>> straight afterwards. >>> >>> >>> On 1 May 2013 15:56, Leonel Câmara wrote: >>> >>>> I guess you could add 429 to gluon.http definitions in your model and >>>> then use it, but I haven't tried it >>>> >>>> Something like thin in your model >>>> >>>> from gluon import http >>>> >>>> http.defined_status[429] = 'Too Many Request' >>>> >>>> And then in your controllers >>>> >>>> raise HTTP(429) >>>> >>>> Quarta-feira, 1 de Maio de 2013 15:13:05 UTC+1, Carl escreveu: >>>> >>>>> Web2py supports a subset of HTTP status codes as listed here: >>>>> http://en.wikipedia.org/****wiki/List_of_HTTP_status_codes<http://en.wikipedia.org/wiki/List_of_HTTP_status_codes> >>>>> >>>>> The LinkedIn service I am using employs throttling and I'd like to >>>>> throw a 429 Too Many Requests exception. >>>>> >>>>> Can this status code, along with other missing codes, be added to >>>>> web2py in gluon/http.py? >>>>> >>>>> >>>>> -- >>>> >>>> --- >>>> You received this message because you are subscribed to a topic in the >>>> Google Groups "web2py-users" group. >>>> To unsubscribe from this topic, visit https://groups.google.com/d/** >>>> topic/web2py/03sPc8GVBG0/**unsubscribe?hl=en<https://groups.google.com/d/topic/web2py/03sPc8GVBG0/unsubscribe?hl=en> >>>> . >>>> To unsubscribe from this group and all its topics, send an email to >>>> web2py+un...@**googlegroups.com. >>>> >>>> For more options, visit >>>> https://groups.google.com/**groups/opt_out<https://groups.google.com/groups/opt_out> >>>> . >>>> >>>> >>>> >>> >>> -- > > --- > You received this message because you are subscribed to a topic in the > Google Groups "web2py-users" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/web2py/03sPc8GVBG0/unsubscribe?hl=en. > To unsubscribe from this group and all its topics, send an email to > web2py+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > > > -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.