h
This commit is contained in:
@@ -29,7 +29,8 @@ try:
|
||||
except TypeError:
|
||||
_pretty_install()
|
||||
except Exception:
|
||||
pass
|
||||
from SYS.logger import logger
|
||||
logger.exception("Failed to configure rich pretty-printing")
|
||||
|
||||
_STDOUT_CONSOLE = Console(file=sys.stdout)
|
||||
_STDERR_CONSOLE = Console(file=sys.stderr)
|
||||
@@ -261,8 +262,10 @@ def render_image_to_console(image_path: str | Path, max_width: int | None = None
|
||||
console.print(line)
|
||||
|
||||
except Exception:
|
||||
# Silently fail if image cannot be rendered (e.g. missing PIL or corrupted file)
|
||||
pass
|
||||
# Emit logs to help diagnose rendering failures (PIL missing, corrupt file, terminal limitations)
|
||||
from SYS.logger import logger
|
||||
logger.exception("Failed to render image to console: %s", image_path)
|
||||
return
|
||||
|
||||
|
||||
def render_item_details_panel(item: Dict[str, Any], *, title: Optional[str] = None) -> None:
|
||||
@@ -279,7 +282,8 @@ def render_item_details_panel(item: Dict[str, Any], *, title: Optional[str] = No
|
||||
view.title = ""
|
||||
view.header_lines = []
|
||||
except Exception:
|
||||
pass
|
||||
from SYS.logger import logger
|
||||
logger.exception("Failed to sanitize ItemDetailView title/header before printing")
|
||||
|
||||
# We want to print ONLY the elements from ItemDetailView, so we don't use stdout_console().print(view)
|
||||
# as that would include the (empty) results panel.
|
||||
|
||||
Reference in New Issue
Block a user