From rubyforge at lokorin.org Tue May 5 17:00:18 2009 From: rubyforge at lokorin.org (Andreas Launila) Date: Tue, 05 May 2009 23:00:18 +0200 Subject: [gecoder-devel] Handling of C++ exceptions Message-ID: <4A00A8E2.8090007@lokorin.org> Yet another thing for the todo list: While adapting Gecode/R to Gecode 3.0, one spec threw a C++ exception due to Gecode now throwing exceptions for empty set var domains. It bothered me that the C++ exception was not handled on the Ruby side. If Gecode/R does not catch the erroneous input then the resulting exception halts the Ruby process and an error message is printed, without any stack trace or anything. I doubt Gecode/R checks all input for every exceptional case, so as a defensive measure it would be a good idea to implement some better handling of the C++ exceptions. Something similar to [1] could possibly be implemented in Rust, turning future C++ exceptions that sneak through into Ruby exceptions (so that there is at least a stack trace and a chance to recover). [1] http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/28455 -- Andreas Launila