aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorvgross2010-01-14 18:06:32 +0000
committervgross2010-01-14 18:06:32 +0000
commit5a21a70dd1a5be9a7de01bf1eeae630395a3dce4 (patch)
tree22b015be87c4d57f4978cabe7906474b1574db5a
parent3e233fb59358b63e7d84e3bda4b0b357e3067d68 (diff)
Fix uncaught exception
On windows platform, exceptions are not always encoded in utf-8, thus failing the assert. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@12675 85f007b7-540e-0410-9357-904b9bb8a0f7
-rw-r--r--ide/coqide.ml31
1 files changed, 17 insertions, 14 deletions
diff --git a/ide/coqide.ml b/ide/coqide.ml
index 6e3d867870..542ebe502a 100644
--- a/ide/coqide.ml
+++ b/ide/coqide.ml
@@ -926,23 +926,26 @@ object(self)
self#insert_message (if show_output then msg else "") in
let display_error e =
let (s,loc) = Coq.process_exn e in
- assert (Glib.Utf8.validate s);
- self#insert_message s;
- message_view#misc#draw None;
- if localize then
- (match Option.map Util.unloc loc with
- | None -> ()
- | Some (start,stop) ->
- let convert_pos = byte_offset_to_char_offset phrase in
- let start = convert_pos start in
- let stop = convert_pos stop in
- let i = self#get_start_of_input in
- let starti = i#forward_chars start in
- let stopi = i#forward_chars stop in
+ if not (Glib.Utf8.validate s) then
+ flash_info "This error is so nasty that I can't even display it."
+ else begin
+ self#insert_message s;
+ message_view#misc#draw None;
+ if localize then
+ (match Option.map Util.unloc loc with
+ | None -> ()
+ | Some (start,stop) ->
+ let convert_pos = byte_offset_to_char_offset phrase in
+ let start = convert_pos start in
+ let stop = convert_pos stop in
+ let i = self#get_start_of_input in
+ let starti = i#forward_chars start in
+ let stopi = i#forward_chars stop in
input_buffer#apply_tag Tags.Script.error
~start:starti
~stop:stopi;
- input_buffer#place_cursor starti) in
+ input_buffer#place_cursor starti)
+ end in
try
full_goal_done <- false;
prerr_endline "Send_to_coq starting now";