Permalink
Browse files

Properly handle error.

  • Loading branch information...
chriseppstein committed Feb 8, 2019
1 parent 921492d commit 505adc5ba05a854a45a04dd0eaf8ef05f8763d42
Showing with 2 additions and 4 deletions.
  1. +2 −4 packages/eyeglass/src/importers/ModuleImporter.ts
@@ -6,6 +6,7 @@ import { ImporterFactory, ImportedFile } from "./ImporterFactory";
import { unreachable } from "../util/assertions";
import { ImporterReturnType } from "node-sass";
import { isPresent } from "../util/typescriptUtils";
import errorFor from "../util/errorFor";

const MODULE_PARSER = /^((?:@[^/]+\/[^/]+)|(?:[^/]+))\/?(.*)/;

@@ -158,10 +159,7 @@ const ModuleImporter: ImporterFactory = function (eyeglass, sass, options, fallb

function defaultErrorHandler(done: (data: ImporterReturnType) => void) {
return function (err: Error | string) {
if (!(err instanceof Error)) {
err = new Error(err.toString());
}
done(err);
done(errorFor(err));
};
}
export default ModuleImporter;

0 comments on commit 505adc5

Please sign in to comment.