Return any errors from the script.

This way the script can refuse to become master simply by exiting with
a non-zero code.