I use a service with 'expect' and 'error' functions. I have a backend issue that makes the query fail and the 'expect' clause is not satisfied. My 'error' function correctly triggers, but the log says it is 'successfull'. Here is my service:
{
id: 'setCurrentWebEntityStatus'
,setter: 'statusValidation'
,data: function(settings){ return JSON.stringify({ //JSON RPC
'method' : HYPHE_API.WEBENTITY.SET_STATUS,
'params' : [
settings.shortcuts.webEntityId // web entity id
,settings.shortcuts.status // new status
],
})}
,path:'0.result'
,url: HYPHE_CONFIG.SERVER_ADDRESS, contentType: 'application/x-www-form-urlencoded', type: 'POST'
,expect: function(data){return data[0].code == 'success'}
,error: function(data){alert('Oops, an error occurred... \n\nThe server says:\n'+data)}
}
And here is the log:
[domino] Calling service "setCurrentWebEntityStatus". domino.js:1527
[domino] Service "setCurrentWebEntityStatus" successfull.
I use a service with 'expect' and 'error' functions. I have a backend issue that makes the query fail and the 'expect' clause is not satisfied. My 'error' function correctly triggers, but the log says it is 'successfull'. Here is my service:
And here is the log: [domino] Calling service "setCurrentWebEntityStatus". domino.js:1527 [domino] Service "setCurrentWebEntityStatus" successfull.