I'm currently going a bit mad here, can anybody point me in the right direction?
Currently I am using the latest JS API (1.7.15) along with SFS2X 2.13.6.
I'm throwing an error in JavaScript extension like this:
(I've minimized down the code for the sake of being more readable)
Server Extension:
var SFSLoginException = Java.type('com.smartfoxserver.v2.exceptions.SFSLoginException');
var SFSErrorData = Java.type('com.smartfoxserver.v2.exceptions.SFSErrorData');
var SFSErrorCode = Java.type('com.smartfoxserver.v2.exceptions.SFSErrorCode');
var errData = new SFSErrorData(SFSErrorCode.GENERIC_ERROR);
errData.addParameter("Error thrown from Server");
throw new SFSLoginException("Error thrown from Server", errData);
The error shows up as it should in the smartfox.log too:
WARN | SFSWorker:Ext:2 | Extensions | | <eval>:59:1 com.smartfoxserver.v2.exceptions.SFSLoginException: Error thrown from Server in Extension: ZONE, File: LoginExtension.js
The onLoginError function is the default one:
function onLoginError(evtParams)
{
// Show error
console.log("onLoginError: " + evtParams.errorMessage);
}
However, the onLoginError function is never called when the server throws the error this way and happily continues forward, other errors that are being thrown by SmartFox do show up in the onLoginError function as they should though.
I'm sure I'm overlooking something here, and I'd be happy if somebody could point it out to me.
Thanks!