Turn exception into assertion