diff options
author | eric thul <thul.eric@gmail.com> | 2016-11-05 14:01:18 -0400 |
---|---|---|
committer | eric thul <thul.eric@gmail.com> | 2016-11-05 14:01:18 -0400 |
commit | 4b99e432d63e7a0ce8ad8d2184232417853bfd2b (patch) | |
tree | 8b0cf5796e152f2b76753de40576ca193933f004 /src/Psc.js | |
parent | 2cca7e91062917d3239f179770133175350af7cc (diff) | |
download | purs-loader-4b99e432d63e7a0ce8ad8d2184232417853bfd2b.tar.gz purs-loader-4b99e432d63e7a0ce8ad8d2184232417853bfd2b.tar.zst purs-loader-4b99e432d63e7a0ce8ad8d2184232417853bfd2b.zip |
Wrapping reject values in Error objects
Diffstat (limited to 'src/Psc.js')
-rw-r--r-- | src/Psc.js | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -41,7 +41,7 @@ function compile(psModule) { | |||
41 | cache.compilationFinished = true | 41 | cache.compilationFinished = true |
42 | if (code !== 0) { | 42 | if (code !== 0) { |
43 | cache.errors = stderr.join('') | 43 | cache.errors = stderr.join('') |
44 | reject(true) | 44 | reject(new Error('compilation failed')) |
45 | } else { | 45 | } else { |
46 | cache.warnings = stderr.join('') | 46 | cache.warnings = stderr.join('') |
47 | resolve(psModule) | 47 | resolve(psModule) |
@@ -83,7 +83,7 @@ function bundle(options, cache) { | |||
83 | compilation.on('close', code => { | 83 | compilation.on('close', code => { |
84 | if (code !== 0) { | 84 | if (code !== 0) { |
85 | cache.errors = (cache.errors || '') + stderr.join('') | 85 | cache.errors = (cache.errors || '') + stderr.join('') |
86 | return reject(true) | 86 | return reject(new Error('bundling failed')) |
87 | } | 87 | } |
88 | cache.bundle = stderr | 88 | cache.bundle = stderr |
89 | resolve(fs.appendFileAsync(options.bundleOutput, `module.exports = ${options.bundleNamespace}`)) | 89 | resolve(fs.appendFileAsync(options.bundleOutput, `module.exports = ${options.bundleNamespace}`)) |