INNER CODE UNIT · Python

_parse_instruction_error_code

FLOCK4H/Dexter · Dexter.py:140

def _parse_instruction_error_code(result: str | None) -> int | None:
    if not result or not isinstance(result, str):
        return None
    if not result.startswith("InstructionError"):
        return None
    _prefix, _separator, raw_code = result.partition(":")
    if not raw_code:
        return None
    try:
        return int(raw_code)
    except (TypeError, ValueError):
        return None


def _managed_positions_path(config) -> Path:
    return config.paths.state_dir / MANAGED_POSITIONS_FILENAME

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…