Paste: is this a correct usage of exception?

Author: randy7
Mode: factor
Date: Sat, 17 Jan 2009 21:09:00
Plain Text |
ERROR: http-error-code http-code ;

: valid-response? ( status content -- content http-code ? )
    swap code>> dup 
    { 400 404 503 } member? not ;

: get-xml ( url -- xml )
    http-get valid-response? [ drop ] [ nip http-error-code ] if
    string>xml ;  

New Annotation

Summary:
Author:
Mode:
Body: