Throw exception instead of asserting.