Raise RuntimeError instead of using the nonexistent self.error

Fixes #136.
Merge djmitche/build-relengapi:issue136 (PR #136)