refactor(errors): replace silent exception handling in core packages
This commit is contained in:
1 parent
584bb2d09c
commit
47e7cb6620
21 files changed
+132
-58
No files matched your search
@@ -133,7 +133,7 @@ def spawn_daemon(
|
||||
if log_handle is not subprocess.DEVNULL:
|
||||
try:
|
||||
log_handle.close()
|
||||
except Exception:
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
|
||||
|
||||
@@ -152,7 +152,8 @@ class DevicePool:
|
||||
if proc is not None:
|
||||
try:
|
||||
proc.kill()
|
||||
except Exception:
|
||||
except (ProcessLookupError, OSError):
|
||||
# Process already exited; nothing left to clean up.
|
||||
pass
|
||||
return None
|
||||
|
||||
@@ -256,7 +257,8 @@ class DevicePool:
|
||||
if proc is not None:
|
||||
try:
|
||||
proc.kill()
|
||||
except Exception:
|
||||
except (ProcessLookupError, OSError):
|
||||
# Process already exited; nothing left to clean up.
|
||||
pass
|
||||
|
||||
async def warm_up_async(
|
||||
|
||||
@@ -113,8 +113,9 @@ class ProcessSupervisor:
|
||||
logger.debug(f"Failed graceful stop for process {proc}: {e}")
|
||||
try:
|
||||
proc.kill()
|
||||
except Exception:
|
||||
pass
|
||||
except (ProcessLookupError, OSError) as kill_exc:
|
||||
# ProcessLookupError: already exited, nothing to do.
|
||||
logger.debug(f"Failed to kill process {proc}: {kill_exc}")
|
||||
|
||||
|
||||
process_supervisor: ProcessSupervisor = ProcessSupervisor()
|
||||
Reference in new issue
Block a user