Skip to content

Commit 56685f7

Browse files
committed
Ot_carousel: display error messages in console (was: on screen)
1 parent c68c19b commit 56685f7

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

src/widgets/ot_carousel.eliom

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -511,11 +511,17 @@ let%shared spinner () = D.div ~a:[a_class ["ot-icon-animation-spinning"]] []
511511
let%shared generate_content generator =
512512
try%lwt Eliom_shared.Value.local generator ()
513513
with e ->
514-
let a = if Eliom_config.get_debugmode ()
515-
then []
516-
else [a_class ["ot-icon-question"]]
517-
in
518-
Lwt.return @@ div ~a [em [pcdata @@ Printexc.to_string e]]
514+
Lwt.return @@
515+
if Eliom_config.get_debugmode ()
516+
then em [ pcdata (Printexc.to_string e) ]
517+
else begin
518+
let e = Printexc.to_string e in
519+
ignore [%client (Firebug.console##error
520+
(Js.string ("Ot_carousel content failed with "^ ~%e))
521+
: unit)];
522+
em ~a:[ a_class ["ot-icon-error"] ] []
523+
end
524+
519525

520526
let%shared default_fail e =
521527
[

0 commit comments

Comments
 (0)