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):

Timeout based errors.

New in version 3.4.0.

exec_helpers.timeout

int | float

exec_helpers.result

Execution result

Return type:

ExecResult

exec_helpers.stdout

str stdout string or brief string

exec_helpers.stderr

str stdout string or brief string

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:

ExecResult

cmd

str command

returncode

return code

Return type:

int | ExitCodes

expected

expected return codes

Return type:

list[int | ExitCodes]

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) – command

  • errors (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]

expected

expected return codes

Return type:

list[int | ExitCodes]

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) – command

  • exceptions (dict[tuple[str, int], Exception]) – Exception on connections

  • errors (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]

expected

expected return codes

Return type:

list[int | ExitCodes]