From a1278052c7644b8975533ae3ca35626694f79bc3 Mon Sep 17 00:00:00 2001 From: missinglink Date: Wed, 20 Dec 2023 11:43:56 +0100 Subject: [PATCH] fix(errors): correctly display string-typed errors --- import.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/import.js b/import.js index 6b053489..308e86ea 100644 --- a/import.js +++ b/import.js @@ -1,3 +1,4 @@ +const _ = require('lodash'); var peliasConfig = require( 'pelias-config' ).generate(require('./schema')); var readStreamModule = require('./src/readStream'); var importStream = require('./src/importStream'); @@ -15,7 +16,7 @@ var wofAdminRecords = {}; bundles.generateBundleList((err, bundlesToImport) => { if (err) { - throw new Error(err.message); + throw (_.isError(err) ? err : new Error(err)); } // This can be either csv or db files, the read stream module will do the job