Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions src/coverlet.core/Instrumentation/Instrumenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,18 @@ public Instrumenter(string module, string identifier, string[] excludeFilters, s
_logger = logger;
}

public bool CanInstrument() => InstrumentationHelper.HasPdb(_module);
public bool CanInstrument()
{
try
{
return InstrumentationHelper.HasPdb(_module);
}
catch (Exception ex)
{
_logger.LogWarning($"Unable to instrument module: '{_module}' because : {ex.Message}");
return false;
}
}

public InstrumenterResult Instrument()
{
Expand Down Expand Up @@ -602,4 +613,4 @@ public MethodReference ImportReference(MethodReference method, IGenericParameter
}
}
}
}
}