cache.compilationFinished = true
if (code !== 0) {
cache.errors = stderr.join('')
- reject(true)
+ reject(new Error('compilation failed'))
} else {
cache.warnings = stderr.join('')
resolve(psModule)
compilation.on('close', code => {
if (code !== 0) {
cache.errors = (cache.errors || '') + stderr.join('')
- return reject(true)
+ return reject(new Error('bundling failed'))
}
cache.bundle = stderr
resolve(fs.appendFileAsync(options.bundleOutput, `module.exports = ${options.bundleNamespace}`))
ideClient.stderr.on('data', data => {
debug(data.toString())
cache.ideServer = false
- reject(true)
+ reject(new Error('psc-ide-client failed'))
})
ideClient.stdout.once('data', data => {
debug(data.toString())
resolve(psModule)
} else {
cache.ideServer = ideServer
- reject(true)
+ reject(new Error('psc-ide-client failed'))
}
} else {
cache.ideServer = false
- reject(true)
+ reject(new Error('psc-ide-client failed'))
}
})
ideClient.stdin.resume()
if (res && !Array.isArray(res.result)) {
return res.resultType === 'success'
? resolve(psModule)
- : reject('psc-ide rebuild failed')
+ : reject(new Error('psc-ide rebuild failed'))
}
Promise.map(res.result, (item, i) => {
}))
.then(() => request({ command: 'load' }))
.then(resolve)
- .catch(() => reject('psc-ide rebuild failed'))
+ .catch(() => reject(new Error('psc-ide rebuild failed')))
}
cache.errors = compileMessages.join('\n')
- reject('psc-ide rebuild failed')
+ reject(new Error('psc-ide rebuild failed'))
} else {
cache.warnings = compileMessages.join('\n')
resolve(psModule)
}))
.catch(error => {
cache.deferred[0].reject(error)
- cache.deferred.slice(1).forEach(psModule => psModule.reject(true))
+ cache.deferred.slice(1).forEach(psModule => psModule.reject(new Error('purs-loader failed')))
})
}
}