Page 1 of 1

Derive from std::exception

Posted: Tue Nov 28, 2006 13:42
by vr
Hi all.

You have all done a good job all this CEGUI stuff.

There is however one thing that Im a little disturbed about. (for now...)


There is a class Exception that does not derive from std::exception.
This makes it impossible to catch an exception thrown from CEGUI unless you catch it with ... or the explicit CEGUI exception.

Now, why would this be a problem?
Consider using the lua integration of CEGUI.

I have a dynamic pluginsystem where I have all of the CEGUI functionality compiled into a dynamic library (.dll).

THis is loaded from the app like:

scriptMgr->requestPlugin("cegui") // load and register the CEGUI specific stuff in a general LUA state.

What I can do then is execute lua code from my main app without linking to the CEGUI library at all. Such as:

scriptMgr->doString("CEGUI.SchemeManager:getSingleton():loadScheme("WindowsLook.scheme");

this works just fine, except if there is a problem of loading the sceme (or font or whatever problem there can be), then CEGUI throws an exception.
As I said earlier, there is no way for me to catch this, except of using (...) catch clausule, or by including the CEGUIExceptions.h which makes Main aware of something called CEGUI, which Im trying to avoid...(this goes for a lot other packages handled the same way).

Posted: Thu Dec 14, 2006 08:37
by gcarlton
This has my vote too. Should definitely be done for the next release.

Posted: Thu Dec 14, 2006 11:00
by lindquist
I have no problem with this change!