break out error reporting
use if rather than assert