I'm generally against using AssertionErrors for flow control. This, and other places using assertions to break the app on error should raise an appropriate exception for the type of error encountered.