return the number of errors as the process end code