Consider using KeyError instead of just RuntimeError.