Fixed code generation
This commit is contained in:
@ -194,8 +194,11 @@ function genFactory (folder, paths) {
|
||||
|
||||
return apis
|
||||
|
||||
function handleError(err, callback) {
|
||||
if (callback) return callback(err, result)
|
||||
function handleError (err, callback) {
|
||||
if (callback) {
|
||||
process.nextTick(callback, err, result)
|
||||
return { then: noop, catch: noop, abort: noop }
|
||||
}
|
||||
return Promise.reject(err)
|
||||
}
|
||||
|
||||
@ -230,6 +233,8 @@ function genFactory (folder, paths) {
|
||||
}
|
||||
}
|
||||
|
||||
function noop () {}
|
||||
|
||||
module.exports = ESAPI
|
||||
`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user