Refactor handle_commitment_signed to wrapper error handling function