Sorry, my fault ... wrong order ... constructor declaration behind the exception solved the problem. Sorry for bothering you :)

Vit





vondruch@amberg.cz

22.05.2009 15:33

Komu
swig-user@lists.sourceforge.net
Kopie
Předmět
[Swig-user] Exception in constructor





Hello everybody,

Is there any way how to catch exception thrown from constructor?


Lets say I have following class in my .i file:


class
Foo
{

public
:
       Foo();

       %exception {

               
try {
                       $action

               }

               
catch (...) {
                       
static VALUE range_error = rb_define_class("CuboidPathFinderException", rb_eStandardError);
                       rb_raise(range_error,
"Exception");
               }

       }


       
void someMethod();
};


The exception can be caught for
someMethod but unfortunatelly not for constructor. Any advice?

Thanks.



Vit
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship.
http://www.creativitycat.com _______________________________________________
Swig-user mailing list
Swig-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/swig-user