Different calls may produce different errors that may need to be handled differently. Users can set a flag to disable throwing exceptions on error.
Examples
var deferReturnError = sync.defer(true);
sync.fiber(function() {
var fnCallResult = sync.await(asyncFunction(deferReturnError));
var err = fnCallResult.error; var result = fnCallResult.result;
}
synchronizedFn = sync(asyncFunction);
sync.fiber(function() {
var fnCallResult = synchronizedFn(arg1, arg2, sync.returnErrorValue);
var err = fnCallResult.error; var result = fnCallResult.result;
}
Or ES6 style
var deferReturnError = sync.defer(true);
sync.fiber(function() {
const { error, result } = sync.await(asyncFunction(deferReturnError));
}
Different calls may produce different errors that may need to be handled differently. Users can set a flag to disable throwing exceptions on error.
Examples
Or ES6 style