Avoiding Exceptions

If you attempt to call a function on a library that was not successfully loaded, SBM ModScript throws a runtime exception. To avoid this, a good practice is to verify that the library is loaded before calling a function. For example:

if( sbmLib.IsLibraryLoaded() ) {
	var arg2 = 10;
	sbmLib.CallLibraryFunction( "TestFunction", "arg1", arg2 );
}

For more information, see Lib.