Add spec for error case