5 Commits

Author SHA1 Message Date
google-labs-jules[bot]
172617a523 Fix: Enhance logging for OSError and prevent AttributeError
This commit addresses two potential issues related to issue #50:

1.  Enhanced `OSError` Logging in `utils.py`:
    The `printResponse` function in `src-python/utils.py` has been modified
    to include more robust error handling around the `json.dumps()` call.
    If an `OSError` (such as `[Errno 22] Invalid argument`) occurs during
    JSON serialization, the function will now:
    - Log the full traceback of the OSError.
    - Log the specific problematic response dictionary that caused the error.
    - Print a fallback JSON error message to stdout.
    This change aims to help diagnose the root cause of the `OSError`
    reported by you by capturing the exact data that triggers it.

2.  Prevent `AttributeError` for `.close()` calls:
    Added checks in `src-python/models/osc/osc.py` and
    `src-python/models/websocket/websocket_server.py` to ensure that
    objects are not `None` before their `.close()` or `.cancel()` methods
    are called. This specifically addresses:
    - `self.browser.zc.close()` and `self.browser.browser.cancel()` in `osc.py`.
    - `self._loop.close()` in `websocket_server.py`.
    These changes prevent potential `AttributeError: 'NoneType' object
    has no attribute 'close'` errors if these objects are not fully
    initialized before cleanup.
2025-06-18 14:47:17 +00:00
misyaguziya
e7304247c7 [Update] WebSocket configuration: Change host to 127.0.0.1 and port to 2231; refactor WebSocket server initialization and message handling 2025-05-18 15:20:27 +09:00
misyaguziya
ed5ebcee90 [Update] WebSocket server: Refactor threading and message handling 2025-05-18 13:16:52 +09:00
misyaguziya
d940097e44 👍️[Update] Model : WebSocket module 2025-05-17 09:30:17 +09:00
misyaguziya
fac33e06ba [Add] websocket server 2025-05-15 11:46:13 +09:00