fail with own error classes instead of plain RuntimeError