HomeClusterLabs Projects

Refactor: tools: Use g_set_error throughout crm_node.

Description

Refactor: tools: Use g_set_error throughout crm_node.

This is in preparation for converting to formatted output. Basically,
everywhere we were calling fprintf for an error message and their
returning should be a call to g_set_error. There are a couple other
things going on here:

  • I skipped the spot where we're printing out command line usage. This will get handled by formatted output code.
  • I removed a call to crm_err in a command line callback that seems redundant, as well as replaced a call elsewhere. This means these won't be logged, but I'm not sure it's terribly important.
  • There were several spots in controller_event_cb where we returned an error message but didn't set any particular error code. I've changed these to set exit_code to CRM_EX_PROTOCOL.

Details

Provenance
clumensAuthored on Jul 13 2023, 10:40 AM
Parents
rPebd12e3281f9: Refactor: tools: Make error a static global variable in crm_node.c.
Branches
Unknown
Tags
Unknown