diff options
| author | xXJSONDeruloXx <danielhimebauch@gmail.com> | 2025-10-19 11:55:54 -0400 |
|---|---|---|
| committer | xXJSONDeruloXx <danielhimebauch@gmail.com> | 2025-10-19 11:55:54 -0400 |
| commit | cecbefc71eacf8ae61a36bbb7fe06eb8c1fa03c6 (patch) | |
| tree | b3f09b029d9ccd2655c05888759d9be3477780ff /py_modules/lsfg_vk/base_service.py | |
| parent | f076064a9c064a7e2ca74be013e2174aec8a0a1e (diff) | |
| download | decky-lsfg-vk-cecbefc71eacf8ae61a36bbb7fe06eb8c1fa03c6.tar.gz decky-lsfg-vk-cecbefc71eacf8ae61a36bbb7fe06eb8c1fa03c6.zip | |
chore: clean up imports, rm dupe inits, bump ver
Diffstat (limited to 'py_modules/lsfg_vk/base_service.py')
| -rw-r--r-- | py_modules/lsfg_vk/base_service.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/py_modules/lsfg_vk/base_service.py b/py_modules/lsfg_vk/base_service.py index b684ec9..9c3dec3 100644 --- a/py_modules/lsfg_vk/base_service.py +++ b/py_modules/lsfg_vk/base_service.py @@ -2,11 +2,14 @@ Base service class with common functionality. """ +import logging import os import shutil from pathlib import Path from typing import Any, Optional, TypeVar, Dict +import decky + from .constants import LOCAL_LIB, LOCAL_SHARE_BASE, VULKAN_LAYER_DIR, SCRIPT_NAME, CONFIG_DIR, CONFIG_FILENAME # Generic type for response dictionaries @@ -23,7 +26,6 @@ class BaseService: logger: Logger instance, defaults to decky.logger if None """ if logger is None: - import decky self.log = decky.logger else: self.log = logger @@ -90,8 +92,8 @@ class BaseService: path.chmod(mode) self.log.info(f"Wrote to {path}") - except Exception: - self.log.error(f"Failed to write to {path}") + except (OSError, IOError, PermissionError) as e: + self.log.error(f"Failed to write to {path}: {e}") raise def _success_response(self, response_type: type, message: str = "", **kwargs) -> Any: |
