assert( r >= 0 )
where r is the returned value is sufficient to pinpoint where the configuration failed.If a function failed during the configuration, the Build method will always fail with a return code of asINVALID_CONFIGURATION. Unless you already verified the error codes for all the configuration calls, it will not be possible to determine what the error was.
// Verifying the return code with an assert is simple and won't pollute the code r = engine->RegisterGlobalFunction("void func()", asFUNCTION(func), asCALL_CDECL); assert( r >= 0 );
assert()
can safely be used with engine registrations, since the engine will set the internal state to invalid configuration if a function fails. Even in release mode the failure is discovered when a script is built.
See Message callback for more information on the message callback.