Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

add error check

  • Loading branch information...
commit 6024235a379e31a662cc6cae9b62e22936fba6dd 1 parent 3c01d29
@naota authored
Showing with 13 additions and 5 deletions.
  1. +13 −5 navi2ch-net.el
View
18 navi2ch-net.el
@@ -353,13 +353,21 @@ nil $B$J$i>o$K:F@\B3$9$k!#(B")
(navi2ch-net-ignore-errors
(or navi2ch-net-status
(with-current-buffer (process-buffer proc)
- (while (and (memq (process-status proc) '(open run))
- (goto-char (point-min))
- (not (looking-at "HTTP/1\\.[01] \\([0-9]+\\)")))
- (accept-process-output proc))
+ (let ((limit (time-add (current-time) (seconds-to-time 10))))
+ (while (and (memq (process-status proc) '(open run))
+ (goto-char (point-min))
+ (not (looking-at "HTTP/1\\.[01] \\([0-9]+\\)"))
+ (time-less-p (current-time) limit))
+ (accept-process-output proc)))
(goto-char (point-min))
(if (looking-at "HTTP/1\\.[01] \\([0-9]+\\)")
- (setq navi2ch-net-status (match-string 1)))))))
+ (setq navi2ch-net-status (match-string 1))
+ (goto-char (point-max))
+ (insert (format "\n\nstatus: %s" (process-status proc)))
+ (write-region (point-min) (point-max)
+ (expand-file-name "navi2ch-net-get-status-error.txt"
+ navi2ch-directory))
+ (error "Failed to find HTTP status"))))))
(defun navi2ch-net-get-protocol (proc)
(when (navi2ch-net-get-status proc)
Please sign in to comment.
Something went wrong with that request. Please try again.