On 04/05/12 18:07, lkcl luke wrote:
>> Hello, all!
>>
>> When using pyjd, if I make ajax calls from gui callbacks (when user presses
>> a button, for example), it works fine.
>> However, when I try to call ajax from scheduled timer callbacks, or when
>> initializing application - it fails.
>>
>   *lol*.
>
>   yeahh... ok, vsevolod: what i suggest is you put a try: except: block
> around it, if the 5-arg version fails just try the original 2-arg one
> instead, ok?
>
>   
If I understood you correctly, you already did that two commit later.
The failing is second, 2-arg variant. It is tried after 5-arg failure.
This is traceback:
-----
Traceback (most recent call last):
   File "index.py", line 46, in <module>
     main()
   File "index.py", line 43, in main
     test = Test()
   File "index.py", line 17, in __init__
     self.makeAjaxCall()  # will fail
   File "index.py", line 21, in makeAjaxCall
     self.svc.echo(self, 'test arg')
   File "/home/seva/pyjamas/library/pyjamas/JSONService.py", line 255, 
in __call__
     params, handler)
   File "/home/seva/pyjamas/library/pyjamas/JSONService.py", line 137, 
in sendRequest
     self.headers):
   File "/home/seva/pyjamas/library/pyjamas/HTTPRequest.py", line 37, in 
asyncPost
     returnxml, content_type, headers)
   File "/home/seva/pyjamas/library/pyjamas/HTTPRequest.py", line 172, 
in asyncImpl
     res = xmlHttp.open(method, url)
   File "<XPCOMObject method 'open'>", line 3, in open
xpcom.Exception: -1041039359 (NS_ERROR_NOT_INITIALIZED)
---

Seva

Reply via email to