API: exceptions¶
- exception exec_helpers.ExecHelperError(Exception)[source]¶
Base class for all exceptions raised inside.
- exception exec_helpers.DeserializeValueError(ExecHelperError, ValueError)¶
Deserialize impossible.
- exception exec_helpers.ExecCalledProcessError(ExecHelperError)[source]¶
Base class for process call errors.
class ExecHelperTimeoutProcessError(ExecCalledProcessError):
- exception exec_helpers.ExecHelperNoKillError(ExecHelperTimeoutProcessError)[source]¶
Impossible to kill process.
New in version 3.4.0.
- __init__(self, result, timeout)[source]¶
Exception for error on process calls.
- Parameters:
result (ExecResult) – execution result
timeout (
int | float
) – timeout for command
- exception exec_helpers.ExecHelperTimeoutError(ExecHelperTimeoutProcessError)[source]¶
Execution timeout.
Changed in version 1.3.0: provide full result and timeout inside.
Changed in version 1.3.0: subclass ExecCalledProcessError
- __init__(self, result, timeout)[source]¶
Exception for error on process calls.
- Parameters:
result (ExecResult) – execution result
timeout (
int | float
) – timeout for command
- exception exec_helpers.CalledProcessError(ExecCalledProcessError)[source]¶
Exception for error on process calls.
Changed in version 1.1.1: - provide full result
- __init__(result, expected=(0,))[source]¶
- Parameters:
result (ExecResult) – execution result
expected (Iterable[int | ExitCodes]) – expected return codes
Changed in version 3.4.0: Expected is not optional, defaults os dependent
- result¶
Execution result
- Return type:
- cmd¶
str
command
- stdout¶
str
stdout string or brief string
- stderr¶
str
stdout string or brief string
- exception exec_helpers.ParallelCallProcessError(ExecCalledProcessError)[source]¶
Exception during parallel execution.
- __init__(command, errors, results, expected=(0,))[source]¶
- Parameters:
command (
str
) – commanderrors (dict[tuple[str, int], ExecResult]) – results with errors
results (dict[tuple[str, int], ExecResult]) – all results
expected (Iterable[int | ExitCodes]) – expected return codes
Changed in version 1.0: - fixed inheritance
Changed in version 3.4.0: Expected is not optional, defaults os dependent
- cmd¶
str
command
- errors¶
results with errors
- Return type:
dict[tuple[str, int], ExecResult]
- results¶
all results
- Return type:
dict[tuple[str, int], ExecResult]
- exception exec_helpers.ParallelCallExceptionsError(ParallelCallProcessError)[source]¶
Exception raised during parallel call as result of exceptions.
- __init__(command, exceptions, errors, results, expected=(0,))[source]¶
- Parameters:
command (
str
) – commandexceptions (
dict[tuple[str, int], Exception]
) – Exception on connectionserrors (dict[tuple[str, int], ExecResult]) – results with errors
results (dict[tuple[str, int], ExecResult]) – all results
expected (Iterable[int | ExitCodes]) – expected return codes
Changed in version 1.0: - fixed inheritance
Changed in version 3.4.0: Expected is not optional, defaults os dependent
- cmd¶
str
command
- exceptions¶
dict[tuple[str, int], Exception]
Exception on connections
- errors¶
results with errors
- Return type:
dict[tuple[str, int], ExecResult]
- results¶
all results
- Return type:
dict[tuple[str, int], ExecResult]