summaryrefslogtreecommitdiffstats
path: root/ds9/library
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2019-05-28 20:15:45 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2019-05-28 20:15:45 (GMT)
commit2222fb279bd3127891eeb1d57e35dcba0e3f3d83 (patch)
tree5ff16be2e9b57b31f284c0a4217f262f2412f5df /ds9/library
parenta2ec298aae86bcf577e28753820cb6399b1b80b4 (diff)
parent45619b5d0d1e761db43f1d8302c223b6746bb998 (diff)
downloadblt-2222fb279bd3127891eeb1d57e35dcba0e3f3d83.zip
blt-2222fb279bd3127891eeb1d57e35dcba0e3f3d83.tar.gz
blt-2222fb279bd3127891eeb1d57e35dcba0e3f3d83.tar.bz2
merge
Diffstat (limited to 'ds9/library')
-rw-r--r--ds9/library/url.tcl22
1 files changed, 13 insertions, 9 deletions
diff --git a/ds9/library/url.tcl b/ds9/library/url.tcl
index 7ad5c60..ce63cd8 100644
--- a/ds9/library/url.tcl
+++ b/ds9/library/url.tcl
@@ -55,6 +55,7 @@ proc GetFileHTTP {url fn} {
-timeout $ihttp(timeout) \
-headers "[ProxyHTTP]"} token]} {
close $ch
+ Error "[msgcat::mc {Unable to locate URL}] $var(url)"
return
}
@@ -138,17 +139,20 @@ proc LoadURLFitsHTTP {url layer mode} {
set fn [tmpnam [file extension $r(path)]]
set ch [open $fn w]
- set token [http::geturl $url \
- -channel $ch \
- -binary 1 \
- -timeout $ihttp(timeout) \
- -headers "[ProxyHTTP]"]
+ if {[catch {set token [http::geturl $url \
+ -channel $ch \
+ -binary 1 \
+ -timeout $ihttp(timeout) \
+ -headers "[ProxyHTTP]"]}]} {
+ close $var(ch)
+ Error "[msgcat::mc {Unable to locate URL}] $url"
+ }
# reset errorInfo (may be set in http::geturl)
global errorInfo
set errorInfo {}
- catch {close $ch}
+ close $ch
upvar #0 $token t
@@ -225,8 +229,10 @@ proc LoadURLFitsHTTP {url layer mode} {
}
switch -- [string tolower $mime] {
+ "text/plain" -
+ "text/html" -
"application/octet-stream" {
- # its never fails, someone can't get there mime types correct.
+ # it never fails, someone can't get there mime types correct.
# Override the mime type based on path
switch -- [file extension $fn] {
.bz2 {set var(encoding) bzip2}
@@ -264,8 +270,6 @@ proc LoadURLFitsHTTP {url layer mode} {
"image/x-zfits" -
"binary/x-zfits" {set encoding pack}
- "text/plain" {}
- "text/html" -
default {
Error "[msgcat::mc {File not Found or Unable to load FITS data MIME type}] $mime"
return