diff options
| -rw-r--r-- | src/transport.lisp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/transport.lisp b/src/transport.lisp index 12e09f4..52d0dcf 100644 --- a/src/transport.lisp +++ b/src/transport.lisp | |||
| @@ -29,8 +29,12 @@ | |||
| 29 | (handler-case (dex:request uri :method method :content content :read-timeout 60 :connect-timeout 60) | 29 | (handler-case (dex:request uri :method method :content content :read-timeout 60 :connect-timeout 60) |
| 30 | ;; We deal with too many requests manually | 30 | ;; We deal with too many requests manually |
| 31 | (dex:http-request-too-many-requests (e) (dex:ignore-and-continue e)) | 31 | (dex:http-request-too-many-requests (e) (dex:ignore-and-continue e)) |
| 32 | (dex:http-request-failed (e) (funcall retrier e)) | 32 | (dex:http-request-failed (e) |
| 33 | (cl+ssl::ssl-error (e) (funcall retrier e))))) | 33 | (log:warn "HTTP request failed: ~A" e) |
| 34 | (funcall retrier e)) | ||
| 35 | (cl+ssl::ssl-error (e) | ||
| 36 | (log:warn "SSL error: ~A" e) | ||
| 37 | (funcall retrier e))))) | ||
| 34 | 38 | ||
| 35 | ;; TODO: (alist string t) | 39 | ;; TODO: (alist string t) |
| 36 | (-> do-call% (http-method string t list) t) | 40 | (-> do-call% (http-method string t list) t) |
| @@ -39,7 +43,7 @@ | |||
| 39 | 43 | ||
| 40 | See `do-call'." | 44 | See `do-call'." |
| 41 | (let* ((body (req uri method args-encoded)) | 45 | (let* ((body (req uri method args-encoded)) |
| 42 | (hash (jzon:parse body))) | 46 | (hash (if body (jzon:parse body) (error "TG replied with nothing!")))) |
| 43 | (if (gethash "ok" hash) | 47 | (if (gethash "ok" hash) |
| 44 | (parse-value out-type (gethash "result" hash)) | 48 | (parse-value out-type (gethash "result" hash)) |
| 45 | (let* ((error-code (gethash "error_code" hash)) | 49 | (let* ((error-code (gethash "error_code" hash)) |