Correctly log errors on remote close

[ci skip]