Throw exceptions instead of asserting.