Add errorThrown attribute on mock