Description
When you try to send an error to the callback function in "add" the server logs the error but it isn't sent to "act". The error variable in "act" is null and the response is {}.
Example
Service
.add(
{generate: 'error'},
function (args, done) {
try {
JSON.parse('!#%&');
} catch (error) {
done(error);
}
}
)
Output:
2014-09-10T08:40:14.114Z diyjrnxkxvzc/1410335482374/- ERROR act - - OUT oea0qj5hjv5h generate:error Unexpected token ! action-error {id=oea0qj5hjv5h,gate=false,ungate=true,pattern=generate:error,plugin={name=-,tag=-},time={start=1410338414113,end=1410338414113}} SyntaxError: Unexpected token !
at Object.parse (native)
at Seneca.<anonymous> (/Users/webdbdev3/Desktop/arbetslager/senecatest/geomService.js:55:14)
at Object.$.executor.execute.fn (/Users/webdbdev3/Desktop/arbetslager/senecatest/node_modules/seneca/lib/seneca.js:1334:24)
at Object._onImmediate (/Users/webdbdev3/Desktop/arbetslager/senecatest/node_modules/seneca/lib/executor.js:93:14)
at processImmediate [as _immediateCallback] (timers.js:345:15)
Client
.act(
{generate: 'error'},
function (error, response) {
console.log('error is');
console.log(error);
console.log('response is');
console.log(response);
}
)
Output:
error is
null
response is
{}
Description
When you try to send an error to the callback function in "add" the server logs the error but it isn't sent to "act". The error variable in "act" is null and the response is {}.
Example
Service
Output:
Client
Output: