diff options
author | Cyril Sobierajewicz <cyril.sobierajewicz@fretlink.com> | 2018-12-03 11:52:09 +0100 |
---|---|---|
committer | Cyril Sobierajewicz <cyril.sobierajewicz@fretlink.com> | 2018-12-03 11:57:30 +0100 |
commit | 1142175778cdc21add2d4b494a02c53050856aa5 (patch) | |
tree | d6c043020ed9b7c8c568f659105a06beec88b21f /src/index.js | |
parent | 7d28a10594c370194b8c23dfa95e533b2b6067b2 (diff) | |
download | purs-loader-1142175778cdc21add2d4b494a02c53050856aa5.tar.gz purs-loader-1142175778cdc21add2d4b494a02c53050856aa5.tar.zst purs-loader-1142175778cdc21add2d4b494a02c53050856aa5.zip |
Allow previous loaders to further describe errors
Diffstat (limited to 'src/index.js')
-rw-r--r-- | src/index.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/index.js b/src/index.js index 0b4ecf8..01ad5a6 100644 --- a/src/index.js +++ b/src/index.js | |||
@@ -225,12 +225,14 @@ module.exports = function purescriptLoader(source, map) { | |||
225 | filename: baseModulePath | 225 | filename: baseModulePath |
226 | }; | 226 | }; |
227 | 227 | ||
228 | if (typeof this.extractPursDependenciesFromError === 'function') { | 228 | if (typeof this.describePscError === 'function') { |
229 | const dependencies = this.extractPursDependenciesFromError(error) || []; | 229 | const { dependencies = [], details } = this.describePscError(error, desc); |
230 | 230 | ||
231 | for (const dep of dependencies) { | 231 | for (const dep of dependencies) { |
232 | this.addDependency(dep); | 232 | this.addDependency(dep); |
233 | } | 233 | } |
234 | |||
235 | Object.assign(desc, details); | ||
234 | } | 236 | } |
235 | 237 | ||
236 | modules.push(desc); | 238 | modules.push(desc); |