Skip to content

Exceptions

Every error raised by hwntools derives from HwnError. Some also derive from the matching built-in exception (TimeoutError, ValueError, FileNotFoundError), so generic handlers keep working. Module-specific errors (OpenOCDError, FlashromError, ToolError) derive from HwnError as well.

exceptions

Exception hierarchy used across hwntools.

HwnError

Bases: Exception

Base class for every error raised by hwntools.

HwnTimeoutError

Bases: HwnError, TimeoutError

An expected response did not arrive in time.

ParseError

Bases: HwnError, ValueError

Device output could not be parsed.

SafetyError

Bases: HwnError

A destructive operation was requested without force=True.

ToolNotFoundError

Bases: HwnError, FileNotFoundError

A required external program (flashrom, binwalk, ...) is not on PATH.