mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-28 01:16:29 +00:00
get_all_node_records(): display any error encountered and return success status
In many cases we'll want to bail out with an error if the node list can't be retrieved for any reason. This saves some repetitive coding.
This commit is contained in:
@@ -218,7 +218,13 @@ do_witness_register(void)
|
||||
* if repmgr.nodes contains entries, delete if -F/--force provided,
|
||||
* otherwise exit with error
|
||||
*/
|
||||
get_all_node_records(witness_conn, &nodes);
|
||||
if (get_all_node_records(witness_conn, &nodes) == false)
|
||||
{
|
||||
/* get_all_node_records() will display the error */
|
||||
PQfinish(witness_conn);
|
||||
PQfinish(primary_conn);
|
||||
exit(ERR_BAD_CONFIG);
|
||||
}
|
||||
|
||||
log_verbose(LOG_DEBUG, "%i node records found", nodes.node_count);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user