Browse files

web_winston: fix crash when svg() throws exception

  • Loading branch information...
1 parent a9fda10 commit f973899cfe817b825a436e005e3a7452dc675dd9 @nolta nolta committed Sep 26, 2012
Showing with 9 additions and 2 deletions.
  1. +9 −2 extras/web_winston.jl
View
11 extras/web_winston.jl
@@ -5,5 +5,12 @@
load("winston.jl")
import Winston.*
-web_show(user_id, p::PlotContainer) = __Message(__MSG_OUTPUT_HTML, {user_id,svg(p)})
-
+function web_show(user_id, p::PlotContainer)
+ g = nothing
+ try
+ g = svg(p)
+ catch err
+ return __Message(__MSG_OUTPUT_EVAL_ERROR, {user_id, sprint(show,err)})
+ end
+ return __Message(__MSG_OUTPUT_HTML, {user_id, g})
+end

0 comments on commit f973899

Please sign in to comment.