mirror of
https://github.com/agessaman/meshcore-packet-capture.git
synced 2026-04-20 23:23:37 +00:00
More meaningful error logging in health check process
This commit is contained in:
parent
049c844f02
commit
a7c8a3bf39
1 changed files with 14 additions and 1 deletions
|
|
@ -1017,7 +1017,20 @@ class PacketCapture:
|
|||
self.logger.warning("Health check timed out")
|
||||
return False
|
||||
except Exception as e:
|
||||
self.logger.warning(f"Health check command failed: {e}")
|
||||
# Log detailed error information for debugging
|
||||
error_type = type(e).__name__
|
||||
error_msg = str(e)
|
||||
# Check if it's an errno error (common on macOS/Linux)
|
||||
errno_value = getattr(e, 'errno', None)
|
||||
if errno_value is not None:
|
||||
import errno
|
||||
try:
|
||||
errno_name = errno.errorcode.get(errno_value, f"UNKNOWN({errno_value})")
|
||||
self.logger.warning(f"Health check command failed: {error_type} [{errno_name}]: {error_msg}")
|
||||
except (AttributeError, KeyError):
|
||||
self.logger.warning(f"Health check command failed: {error_type} [errno={errno_value}]: {error_msg}")
|
||||
else:
|
||||
self.logger.warning(f"Health check command failed: {error_type}: {error_msg}")
|
||||
return False
|
||||
|
||||
except Exception as e:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue