Ok, I’ll try to explain:
I plan to do my entire current project on AS.
But I know C ++ well enough,
And got used to handling exceptional situations there through the exception mechanism.
The main feature of this mechanism is the absence of manual transmission of errors.
To the top of the call stack.
I would really like to use the same mechanics in AngelScript.
For example:
///----------------------------------------------------------------------------|
/// AngelScript.
///----------------------------------------------------------------------------:
Void foo()
{ bool flag = true;
...
If(flag)
{ throw ("Error: ..."); /// No matching symbol 'throw'
}
...
}
///-----------------------------|
/// No errors here. |
///-----------------------------:
Void func()
{ try
{ foo();
}
catch
{
}
}
///-----------------------------|
/// ... |
///-----------------------------:
Void func()
{ try
{ foo();
}
catch
{ String s = getExceptionInfo (); // No matching symbol'getExceptionInfo'
}
}
Further:
throw and getExceptionInfo are identifiers for C ++.
For AS in Urho, as I noticed, names are registered that do not match the C ++ version.
for example, here the name IsOpen() for C ++ has an alternative get_open() for AS
But now I’m interested in the very possibility of using exceptions in AS.
If anyone knows how, then please give me an example of how to do it correctly …