From 8c409e9251623665b97ea75d52fad51f6f98b7de Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Sun, 17 May 2015 21:59:24 +0100 Subject: [PATCH] chore(doc-gen): improve error handling for missing declaration params --- docs/dgeni-package/processors/readTypeScriptModules.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/dgeni-package/processors/readTypeScriptModules.js b/docs/dgeni-package/processors/readTypeScriptModules.js index 2d897d75f0..8e2965cfb3 100644 --- a/docs/dgeni-package/processors/readTypeScriptModules.js +++ b/docs/dgeni-package/processors/readTypeScriptModules.js @@ -153,13 +153,14 @@ module.exports = function readTypeScriptModules(tsParser, readFilesProcessor, mo return memberDoc; } - function getParameters(typeChecker, symbol) { var declaration = symbol.valueDeclaration || symbol.declarations[0]; var sourceFile = ts.getSourceFileOfNode(declaration); if(!declaration.parameters) { - console.log(declaration); - throw 'missing declaration parameters'; + var location = getLocation(symbol); + throw new Error('missing declaration parameters for "' + symbol.name + + '" in ' + sourceFile.fileName + + ' at line ' + location.start.line); } var signature = typeChecker.getSignatureFromDeclaration(declaration); return declaration.parameters.map(function(parameter) {