Throw exception if wrong result returned