download word throneeds to ws an error if the request did not return a success code (reported by Chris Double)
parent
30191f87e5
commit
694652590f
|
@ -165,7 +165,7 @@ ERROR: download-failed response ;
|
|||
present file-name "?" split1 drop "/" ?tail drop ;
|
||||
|
||||
: download-to ( url file -- )
|
||||
binary [ [ write ] with-http-get drop ] with-file-writer ;
|
||||
binary [ [ write ] with-http-get check-response drop ] with-file-writer ;
|
||||
|
||||
: download ( url -- )
|
||||
dup download-name download-to ;
|
||||
|
|
|
@ -392,4 +392,7 @@ SYMBOL: a
|
|||
|
||||
[ "OK" ] [ "data" "http://localhost/a" add-port http-post nip ] unit-test
|
||||
|
||||
[ ] [ "http://localhost/quit" add-port http-get 2drop ] unit-test
|
||||
! Check that download throws errors (reported by Chris Double)
|
||||
[ "http://localhost/tweet_my_twat" add-port download ] must-fail
|
||||
|
||||
[ ] [ "http://localhost/quit" add-port http-get 2drop ] unit-test
|
||||
|
|
Loading…
Reference in New Issue