Skip to content

return 1 with fatal errors #287

Description

@yakra

// See if we have any errors that should be fatal to the site update process
if (el.error_list.size())
{ cout << "ABORTING due to " << el.error_list.size() << " errors:" << endl;
for (unsignedint i = 0; i < el.error_list.size(); i++)
cout << i+1 << ": " << el.error_list[i] << endl;
return0;
}

should return 1, not 0.
Compare:
# See if we have any errors that should be fatal to the site update process
iflen(el.error_list) >0:
print("ABORTING due to "+str(len(el.error_list)) +" errors:")
foriinrange(len(el.error_list)):
print(str(i+1) +": "+el.error_list[i])
sys.exit(1)

exit(1) is required for localupdate.sh to work properly in event of ErrorList errors aborting the siteupdate process.
C++ needs return 1 for similar functionality with a localupdate-style script.


else { cout << "Error opening directory " << args.userlistfilepath << ". (Not found?)" << endl;
return0;
}

should also be changed. The Python version is different enough to not have an exit here, but if this will terminate the program, it should similarly return 1. Probably make this an ErrorList error too.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions