Skip to content

Commit 8c247c0

Browse files
committed
Improve error reporting when the DeclarationReference parser fails
1 parent 7a76ff6 commit 8c247c0

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

apps/api-extractor-model/src/items/ApiItem.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,13 @@ export class ApiItem {
108108
*/
109109
public get canonicalReference(): DeclarationReference {
110110
if (!this._canonicalReference) {
111-
this._canonicalReference = this.buildCanonicalReference();
111+
try {
112+
this._canonicalReference = this.buildCanonicalReference();
113+
} catch (e) {
114+
const name: string = this.getScopedNameWithinPackage() || this.displayName;
115+
throw new InternalError(`Error building canonical reference for ${name}:\n`
116+
+ e.message);
117+
}
112118
}
113119
return this._canonicalReference;
114120
}

0 commit comments

Comments
 (0)