Skip to content

Commit

Permalink
Ot_spinner: display error messages in console (was: on screen)
Browse files Browse the repository at this point in the history
  • Loading branch information
balat committed Nov 12, 2018
1 parent c18369d commit 1343096
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions css/ot_icons.css
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
background-color: black ;
}

.ot-icon-error::before,
.ot-icon-question::before {
content: '?' ;
display: block ;
Expand Down
10 changes: 8 additions & 2 deletions src/widgets/ot_spinner.eliom
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,14 @@ let%shared default_fail e =
[
if Eliom_config.get_debugmode ()
then em [ pcdata (Printexc.to_string e) ]
else em ~a:[ a_class ["ot-icon-question"] ]
[ pcdata (Printexc.to_string e) ] ]
else begin
let e = Printexc.to_string e in
ignore [%client (Firebug.console##error
(Js.string ("Ot_spinner content failed with "^ ~%e))
: unit)];
em ~a:[ a_class ["ot-icon-error"] ] []
end
]

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

0 comments on commit 1343096

Please sign in to comment.