INNER CODE UNIT · Python

ok

renezander030/capcut-cli · python/capcut/__init__.py:77

    def ok(self) -> bool:
        return self.status == 0

    @property
    def error(self) -> Optional[str]:
        """The CLI's own error message when it printed ``{"error": ...}``."""
        if isinstance(self.data, dict) and isinstance(self.data.get("error"), str):
            return self.data["error"]
        return None


class CommandError(CapcutError):
    """The command exited non-zero. ``result`` carries status, streams and parsed JSON."""

    def __init__(self, result: Result):
        self.result = result
        message = result.error or result.stderr.strip() or result.stdout.strip() or f"exit {result.status}"
        super().__init__(f"capcut {result.cmd} failed (exit {result.status}): {message}")

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…