Skip to content

Commit 1343096

Browse files
committed
Ot_spinner: display error messages in console (was: on screen)
1 parent c18369d commit 1343096

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

css/ot_icons.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@
5858
background-color: black ;
5959
}
6060

61+
.ot-icon-error::before,
6162
.ot-icon-question::before {
6263
content: '?' ;
6364
display: block ;

src/widgets/ot_spinner.eliom

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,14 @@ let%shared default_fail e =
2727
[
2828
if Eliom_config.get_debugmode ()
2929
then em [ pcdata (Printexc.to_string e) ]
30-
else em ~a:[ a_class ["ot-icon-question"] ]
31-
[ pcdata (Printexc.to_string e) ] ]
30+
else begin
31+
let e = Printexc.to_string e in
32+
ignore [%client (Firebug.console##error
33+
(Js.string ("Ot_spinner content failed with "^ ~%e))
34+
: unit)];
35+
em ~a:[ a_class ["ot-icon-error"] ] []
36+
end
37+
]
3238

3339
let%server with_spinner ?(a = []) ?fail thread =
3440
let a = (a :> Html_types.div_attrib attrib list) in

0 commit comments

Comments
 (0)