🎉 Celebrating 25 Years of GameDev.net! 🎉
Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!
Exception propagation
If I have a c++ class I have registered with AS and in a call to a method of the object used in a script my method throws an exception, is there anyway to propagate that up to the script engine and report it as a script error?
Thanks,
Scott
There is currently no automatic treatment of C++ exceptions. You'll need to write a wrapper for the class method that catches the exception and raises a script exception instead.
Example:
Example:
void MyWrapper(obj *o){ try { o->DoSomething(); } catch( E& e ) { asIScriptContext *ctx = asGetActiveContext(); if( ctx ) ctx->SetException("An exception occured"); }}
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement