Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssemblyLoader.Load should not throw if loading fails. #1072

Merged
merged 3 commits into from
Jan 29, 2018
Merged
Changes from 1 commit
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
5 changes: 2 additions & 3 deletions src/OmniSharp.Host/Services/AssemblyLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,17 @@ public AssemblyLoader(ILoggerFactory loggerFactory)

public Assembly Load(AssemblyName name)
{
Assembly result;
Assembly result = null;
try
{
result = Assembly.Load(name);
_logger.LogTrace($"Assembly loaded: {name}");
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the only consumer of this method already checks for null; sounds good.

}
catch (Exception ex)
{
_logger.LogError(ex, $"Failed to load assembly: {name}");
throw;
}

_logger.LogTrace($"Assembly loaded: {name}");
return result;
}

Expand Down