Skip to content

Commit

Permalink
fix: ignore unsupported PDB formats (#8631)
Browse files Browse the repository at this point in the history
  • Loading branch information
yufeih authored Apr 12, 2023
1 parent a9fb70e commit 9888f99
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
13 changes: 10 additions & 3 deletions src/Microsoft.DocAsCode.Dotnet/SymbolUrlResolver.SourceLink.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,16 @@ partial class SymbolUrlResolver
return null;
}

return new(
new PEReader(File.OpenRead(pe.FilePath)),
MetadataReaderProvider.FromPortablePdbStream(File.OpenRead(pdbPath)));
try
{
return new(
new PEReader(File.OpenRead(pe.FilePath)),
MetadataReaderProvider.FromPortablePdbStream(File.OpenRead(pdbPath)));
}
catch (BadImageFormatException)
{
return null;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -431,14 +431,7 @@ public string AddSpecReference(
IReadOnlyList<string> typeGenericParameters = null,
IReadOnlyList<string> methodGenericParameters = null)
{
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);
}
return _generator.AddSpecReference(symbol, typeGenericParameters, methodGenericParameters, _references, this);
}

private MemberType GetMemberTypeFromSymbol(ISymbol symbol)
Expand Down

0 comments on commit 9888f99

Please sign in to comment.