From 700b90fd05a0e24d6d4d0a7020c8ac998a33bf8a Mon Sep 17 00:00:00 2001 From: Manoj Patel Date: Tue, 14 Mar 2017 14:49:57 -0700 Subject: [PATCH] Fixes #187: Nicer error messages when a source map fails to parse Adding `mapPath` and `pathToGenerated` to the error message logged. --- src/sourceMaps/sourceMapFactory.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sourceMaps/sourceMapFactory.ts b/src/sourceMaps/sourceMapFactory.ts index 4f2d4195b..84ee05875 100644 --- a/src/sourceMaps/sourceMapFactory.ts +++ b/src/sourceMaps/sourceMapFactory.ts @@ -39,7 +39,7 @@ export function getMapForGeneratedPath(pathToGenerated: string, mapPath: string, // Throws for invalid JSON return new SourceMap(pathToGenerated, contents, webRoot, sourceMapPathOverrides); } catch (e) { - logger.error(`SourceMaps.getMapForGeneratedPath: exception while processing sourcemap: ${e.stack}`); + logger.error(`SourceMaps.getMapForGeneratedPath: exception while processing path: ${pathToGenerated}, sourcemap: ${mapPath}\n${e.stack}`); return null; } } else {