@@ -29,13 +29,21 @@ set tmpfile "${file}.new" set fd [open $tmpfile "w"] fconfigure $fd -translation binary - set token [::http::geturl $url -channel $fd -binary true] - set ncode [::http::ncode $token] - ::http::reset $token + catch { + set token [::http::geturl $url -channel $fd -binary true] + } + + if {[info exists token]} { + set ncode [::http::ncode $token] + ::http::reset $token + } else { + set ncode "900" + } + close $fd if {$keyIsHash} { catch { set hash [string tolower [exec openssl sha1 $tmpfile]]