]> git.immae.eu Git - github/fretlink/purs-loader.git/commitdiff
Allow previous loaders to further describe errors
authorCyril Sobierajewicz <cyril.sobierajewicz@fretlink.com>
Mon, 3 Dec 2018 10:52:09 +0000 (11:52 +0100)
committerCyril Sobierajewicz <cyril.sobierajewicz@fretlink.com>
Mon, 3 Dec 2018 10:57:30 +0000 (11:57 +0100)
src/index.js

index 0b4ecf8263c99d0ed1eb43912c65bbe1d8cc6f17..01ad5a6a7c4ade477a2cd2811548a002a8db4180 100644 (file)
@@ -225,12 +225,14 @@ module.exports = function purescriptLoader(source, map) {
             filename: baseModulePath
           };
 
-          if (typeof this.extractPursDependenciesFromError === 'function') {
-            const dependencies = this.extractPursDependenciesFromError(error) || [];
+          if (typeof this.describePscError === 'function') {
+            const { dependencies = [], details } = this.describePscError(error, desc);
 
             for (const dep of dependencies) {
               this.addDependency(dep);
             }
+
+            Object.assign(desc, details);
           }
 
           modules.push(desc);