mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-11 15:07:34 +02:00
Better error messages.
This commit is contained in:
parent
3031b50406
commit
78f31ede20
1 changed files with 4 additions and 4 deletions
|
@ -127,7 +127,7 @@
|
|||
(lambda (x)
|
||||
(port->bytevector
|
||||
(open-binary-input-file (cdr x)))))
|
||||
(else (error "")))
|
||||
(else (error "unknown content: " x)))
|
||||
(cdr x)))
|
||||
(content-type
|
||||
(cond ((and (pair? (cdr x))
|
||||
|
@ -157,7 +157,7 @@
|
|||
|
||||
(define (http-call-method method url in-headers body limit)
|
||||
(if (<= limit 0)
|
||||
(error "http-get: redirect limit reached" url)
|
||||
(error "http-get: redirect limit reached" (uri->string url))
|
||||
(let* ((uri (if (uri? url) url (string->uri url)))
|
||||
(host (and uri (uri-host uri))))
|
||||
(if (not host)
|
||||
|
@ -203,11 +203,11 @@
|
|||
(let ((url2 (assq-ref headers 'location)))
|
||||
(if url2
|
||||
(http-get/raw url2 in-headers (- limit 1))
|
||||
(error "redirect with no location header"))))
|
||||
(error "redirect with no location header" url url2))))
|
||||
(else
|
||||
(close-input-port in)
|
||||
(close-output-port out)
|
||||
(error "couldn't retrieve url" url resp)))))))))
|
||||
(error "couldn't retrieve url" (uri->string url) resp)))))))))
|
||||
|
||||
(define (http-get/raw url headers limit)
|
||||
(http-call-method 'GET url headers #f limit))
|
||||
|
|
Loading…
Add table
Reference in a new issue