Skip to content

Commit

Permalink
fix(errors): correctly display string-typed errors
Browse files Browse the repository at this point in the history
  • Loading branch information
missinglink committed Dec 20, 2023
1 parent 9be5fe0 commit a127805
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion import.js
Original file line number Diff line number Diff line change
@@ -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');
Expand All @@ -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
Expand Down

0 comments on commit a127805

Please sign in to comment.