git.annexia.org
/
libguestfs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
4c8bdd3
)
OCaml viewer: Handle exceptions properly.
author
Richard Jones
<rjones@trick.home.annexia.org>
Tue, 29 Sep 2009 10:56:26 +0000
(11:56 +0100)
committer
Richard Jones
<rjones@trick.home.annexia.org>
Tue, 29 Sep 2009 10:56:26 +0000
(11:56 +0100)
ocaml/examples/viewer.ml
patch
|
blob
|
history
diff --git
a/ocaml/examples/viewer.ml
b/ocaml/examples/viewer.ml
index
20fa608
..
ef6627b
100644
(file)
--- a/
ocaml/examples/viewer.ml
+++ b/
ocaml/examples/viewer.ml
@@
-227,6
+227,7
@@
end = struct
*)
debug "Slave.slave_loop: command failed";
*)
debug "Slave.slave_loop: command failed";
+ !busy_cb `Idle;
with_lock q_lock (fun () -> Q.clear q);
GtkThread.async !failure_cb exn
);
with_lock q_lock (fun () -> Q.clear q);
GtkThread.async !failure_cb exn
);
@@
-383,7
+384,13
@@
type display_state = {
* necessary to turn the exception into an error message.
*)
let failure ds exn =
* necessary to turn the exception into an error message.
*)
let failure ds exn =
- debug "failure callback: %s" (Printexc.to_string exn)
+ let title = "Error" in
+ let msg = Printexc.to_string exn in
+ debug "failure callback: %s" msg;
+ let icon = GMisc.image () in
+ icon#set_stock `DIALOG_ERROR;
+ icon#set_icon_size `DIALOG;
+ GToolbox.message_box ~title ~icon msg
(* This is called in the main thread when the slave thread transitions
* to busy or idle.
(* This is called in the main thread when the slave thread transitions
* to busy or idle.