Enable more lints (#91642)
This commit is contained in:
@@ -54,6 +54,8 @@ Future<vms.VmService> _waitAndConnect(
|
||||
await service.getVersion();
|
||||
return service;
|
||||
} catch (e) {
|
||||
// We should not be catching all errors arbitrarily here, this might hide real errors.
|
||||
// TODO(ianh): Determine which exceptions to catch here.
|
||||
await socket.close();
|
||||
if (attempts > 5) {
|
||||
_log.warning('It is taking an unusually long time to connect to the VM...');
|
||||
|
||||
@@ -679,14 +679,13 @@ class _SshPortForwarder implements PortForwarder {
|
||||
/// If successful returns a valid [ServerSocket] (which must be disconnected
|
||||
/// later).
|
||||
static Future<ServerSocket?> _createLocalSocket() async {
|
||||
ServerSocket s;
|
||||
try {
|
||||
s = await ServerSocket.bind(_ipv4Loopback, 0);
|
||||
return await ServerSocket.bind(_ipv4Loopback, 0);
|
||||
} catch (e) {
|
||||
// Failures are signaled by a return value of 0 from this function.
|
||||
// We should not be catching all errors arbitrarily here, this might hide real errors.
|
||||
// TODO(ianh): Determine which exceptions to catch here.
|
||||
_log.warning('_createLocalSocket failed: $e');
|
||||
return null;
|
||||
}
|
||||
return s;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user