From c1703d7b17225484d9c856998bdd63322b1d7a4f Mon Sep 17 00:00:00 2001 From: vwxyzh Date: Thu, 1 Sep 2016 20:02:29 -0700 Subject: [PATCH] Add information for metadata fail. --- .../Visitors/SymbolVisitorAdapter.cs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Microsoft.DocAsCode.Metadata.ManagedReference/Visitors/SymbolVisitorAdapter.cs b/src/Microsoft.DocAsCode.Metadata.ManagedReference/Visitors/SymbolVisitorAdapter.cs index 2a616a6fe41..0fccc04b84c 100644 --- a/src/Microsoft.DocAsCode.Metadata.ManagedReference/Visitors/SymbolVisitorAdapter.cs +++ b/src/Microsoft.DocAsCode.Metadata.ManagedReference/Visitors/SymbolVisitorAdapter.cs @@ -15,6 +15,7 @@ namespace Microsoft.DocAsCode.Metadata.ManagedReference using Microsoft.DocAsCode.Common; using Microsoft.DocAsCode.DataContracts.ManagedReference; + using Microsoft.DocAsCode.Exceptions; public class SymbolVisitorAdapter : SymbolVisitor @@ -430,7 +431,14 @@ public string AddSpecReference( IReadOnlyList typeGenericParameters = null, IReadOnlyList methodGenericParameters = null) { - return _generator.AddSpecReference(symbol, typeGenericParameters, methodGenericParameters, _references, this); + try + { + return _generator.AddSpecReference(symbol, typeGenericParameters, methodGenericParameters, _references, this); + } + catch (Exception ex) + { + throw new DocfxException($"Unable to generate spec reference for {VisitorHelper.GetCommentId(symbol)}", ex); + } } #endregion