doc string for error function