I have many custom events and they require client to pass parameters to this custom event.
These parameters can be integer, string, class, sfsobject and sfsarray.
I want to check if all the required params has been passed to the event before proceeding further.
If any of the params is missing then I want to throw an error so client is aware on which parameter is missing and has to be passed.
How can this check be done in smartfox and how can a error be sent to client
Throw an error/exception if mandatory parameters are not sent to an event
Re: Throw an error/exception if mandatory parameters are not sent to an event
Hi,
just to clarify you mean how to do this in an Extension, right?
Thanks
just to clarify you mean how to do this in an Extension, right?
Thanks
Re: Throw an error/exception if mandatory parameters are not sent to an event
Yes these things are to be done in extension
Re: Throw an error/exception if mandatory parameters are not sent to an event
Ok,
you can simply reply to the client with an error code (or error message) providing the details of what is missing.
From client side you can catch these codes/messages and show them to the user.
Hope it helps
you can simply reply to the client with an error code (or error message) providing the details of what is missing.
From client side you can catch these codes/messages and show them to the user.
Hope it helps
Re: Throw an error/exception if mandatory parameters are not sent to an event
How do I send an error code as an event response?
Do I have to send a new error event?
Is there any way to do it with the following exception?
Do I have to send a new error event?
Is there any way to do it with the following exception?
Code: Select all
SFSException(String message)
Re: Throw an error/exception if mandatory parameters are not sent to an event
Hi,
it's just a custom message. You decide which code or message to send from server to client and handle it on the other side.
No you need to use the send method to send data to the client(s):
Cheers
it's just a custom message. You decide which code or message to send from server to client and handle it on the other side.
Devops wrote:Is there any way to do it with the following exception?Code: Select all
SFSException(String message)
No you need to use the send method to send data to the client(s):
Code: Select all
ISFSObject params = new SFSObject()
params.putInt("errCode", someCode);
send("someAction", params, targetUser);
Cheers
Who is online
Users browsing this forum: No registered users and 60 guests