(tid, code, text, params)
| 76 | |
| 77 | # Resolve or reject the future |
| 78 | def exec_future(tid, code, text, params): |
| 79 | bundle = onCompletion.get(tid) |
| 80 | if bundle != None: |
| 81 | del onCompletion[tid] |
| 82 | try: |
| 83 | if code >= 200 and code < 400: |
| 84 | arg = bundle.get('arg') |
| 85 | bundle.get('onsuccess')(arg, params) |
| 86 | else: |
| 87 | log("Error: {} {} ({})".format(code, text, tid)) |
| 88 | onerror = bundle.get('onerror') |
| 89 | if onerror: |
| 90 | onerror(bundle.get('arg'), {'code': code, 'text': text}) |
| 91 | except Exception as err: |
| 92 | log("Error handling server response", err) |
| 93 | |
| 94 | # List of active subscriptions |
| 95 | subscriptions = {} |
no test coverage detected
searching dependent graphs…