Added setError method