refactoring: write_error_line -> print_error_line