convert assertion into error message