Promise. Both result and error fired.
I am using Promise for connecting to Backened.
Is it possible that both result and error are fired?
In my case this is exactly what happening.
First result handler is called, then error handler.
var p:Promise = restClient_drm.post("SOME_URL", obj); p.addResultHandler(resultHandler); p.addErrorHandler(errorHandler);
Comments are currently closed for this discussion. You can start a new one.
|?||Show this help|
|ESC||Blurs the current field|
|r||Focus the comment reply box|
|^ + ↩||Submit the comment|
You can use
Command ⌘ instead of
Control ^ on Mac
Support Staff 1 Posted by Ondina D.F. on 29 Jul, 2015 09:30 AM
Hello hello ;)
I'm afraid I can't help you much, because my knowledge about promises is more theoretical than practical.
The 3 lines of code you posted look just fine. The cause of the behaviour you've mentioned must lie somewhere else in your code.
Try to reduce the complexity of your code. Start with a very basic example. Questions to ask yourself:
Are you making multiple calls to the server? Are you using some callback functions?
Are you nesting the remote calls? Are you using more than one promise?
Are you sure the error handler is called for the same promise?
The error you're receiving should give you some hints about the origin of the problem, like what happens on your backend server...
What happens if you don't use promises, does the server respond as expected?
Ondina D.F. closed this discussion on 28 Oct, 2015 03:49 PM.