Skip to content

Commit

Permalink
fix: try not to crash on broken connection
Browse files Browse the repository at this point in the history
  • Loading branch information
rdavisau committed Jan 28, 2023
1 parent 4ded71c commit 266553f
Showing 1 changed file with 9 additions and 2 deletions.
Expand Up @@ -222,8 +222,15 @@ public async Task<Outcome> SendAssemblyForReload(EmittedAssembly asm)
? null
: TryResolvePrimaryType(_primaryTypeHint)
};

return await Client.RequestClientLoadAssemblyAsync(req);

try { return await Client.RequestClientLoadAssemblyAsync(req); }
catch (Exception ex)
{
Logger.LogError(ex, "Failed to request assembly load, probably due to remote disconnect. " +
"Terminated: {Terminated}", Terminated);

return new Outcome { Success = false };
}
}

public string? TryResolvePrimaryType(string typeHint)
Expand Down

0 comments on commit 266553f

Please sign in to comment.