fixed error reporting
original commit: 7ab9526c21855ab623ee427bfdb94cd6c90e68e6
This commit is contained in:
parent
3b38ee00be
commit
04a3da9994
|
@ -12,8 +12,10 @@
|
||||||
; send-url : str -> void
|
; send-url : str -> void
|
||||||
(define send-url
|
(define send-url
|
||||||
(opt-lambda (str [separate-window? separate-by-default?])
|
(opt-lambda (str [separate-window? separate-by-default?])
|
||||||
|
; The with-handler reverts to the old error port before printing raised error messages.
|
||||||
|
(with-handlers ([void (lambda (exn) (raise exn))])
|
||||||
(parameterize ([current-input-port null-input]
|
(parameterize ([current-input-port null-input]
|
||||||
[current-error-port null-output] ; comment out this line to see error messages
|
[current-error-port null-output]
|
||||||
[current-output-port null-output])
|
[current-output-port null-output])
|
||||||
(cond
|
(cond
|
||||||
[(eq? (system-type) 'macos)
|
[(eq? (system-type) 'macos)
|
||||||
|
@ -61,7 +63,7 @@
|
||||||
(process*/close-ports browser-path str))]
|
(process*/close-ports browser-path str))]
|
||||||
[else
|
[else
|
||||||
(error 'open-url "Couldn't find Opera, Galeon, Mozilla, Netscape, or Dillo to open URL: ~e" str)]))]
|
(error 'open-url "Couldn't find Opera, Galeon, Mozilla, Netscape, or Dillo to open URL: ~e" str)]))]
|
||||||
[else (error 'send-url "don't know how to open URL on platform: ~s" (system-type))]))))
|
[else (error 'send-url "don't know how to open URL on platform: ~s" (system-type))])))))
|
||||||
|
|
||||||
; : sym sym -> (U #f str)
|
; : sym sym -> (U #f str)
|
||||||
; to find the path for the named browser, unless another browser is preferred
|
; to find the path for the named browser, unless another browser is preferred
|
||||||
|
|
Loading…
Reference in New Issue
Block a user