Skip to content

ResultError

Base classes

Name Children Inherits
ProcessError
clawd_code_sdk._errors
Raised when the CLI process fails.

⋔ Inheritance diagram

graph TD
  57677608["_errors.ResultError"]
  542755718["_errors.ProcessError"]
  2055642102["_errors.ClaudeSDKError"]
  1615621424["builtins.Exception"]
  3224121899["builtins.BaseException"]
  2751680898["builtins.object"]
  542755718 --> 57677608
  2055642102 --> 542755718
  1615621424 --> 2055642102
  3224121899 --> 1615621424
  2751680898 --> 3224121899

🛈 DocStrings

Bases: ProcessError

The CLI reported an error result and then exited non-zero.

Replaces the bare "exit code 1" ProcessError that follows an is_error result frame (e.g. a refused resume, error_max_turns), so the exception carries what the CLI actually reported. Subclasses ProcessError so existing handlers keep catching it. (Upstream #1198/#1205.)

Source code in src/clawd_code_sdk/_errors.py
class ResultError(ProcessError):
    """The CLI reported an error result and then exited non-zero.

    Replaces the bare "exit code 1" ``ProcessError`` that follows an
    ``is_error`` result frame (e.g. a refused resume, ``error_max_turns``), so
    the exception carries what the CLI actually reported. Subclasses
    ``ProcessError`` so existing handlers keep catching it. (Upstream #1198/#1205.)
    """

    def __init__(self, message: str, data: dict[str, Any], exit_code: int | None = None) -> None:
        self.data = data
        super().__init__(message, exit_code=exit_code)

:fa-brands-github: Show source on GitHub