Document addError function