To: lablgtk at kaba.or.jp Subject: Trapping exceptions at the top level? (repost) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-Id: <20030912101328J.garrigue at kurims.kyoto-u.ac.jp> Date: Fri, 12 Sep 2003 10:13:28 +0900 From: Jacques Garrigue Lines: 32 [This mail was sent by Richard Jones ] How do people generally trap unexpected exceptions in their lablgtk apps? I'm thinking of trapping them around the highest level call to GMain.Main.main (), something like: let rec run_main () = try GMain.Main.main () with Sys_error (...) -> (* Some code to post a message_box describing this error. *); run_main () | Unix.Unix_error (...) -> (* Some code to post a message_box describing this error. *); run_main () | Failure ... -> (* Some code to post a message_box describing this error. *); run_main () Is this a good idea? Have others tried this method and found it to be good or bad? Rich. -- Richard Jones. http://www.annexia.org/ http://freshmeat.net/users/rwmj Merjis Ltd. http://www.merjis.com/ - all your business data are belong to you. MONOLITH is an advanced framework for writing web applications in C, easier than using Perl & Java, much faster and smaller, reusable widget-based arch, database-backed, discussion, chat, calendaring: http://www.annexia.org/freeware/monolith/