Feature #3739
closedExpose ControlResponse body in Controller::CommandFailCallback
100%
Description
Currently, Controller::start<Command> fail callback only receives status code and message.
ControlResponse <body> should be exposed to the callback, so that the caller can inspect and take actions accordingly.
      
      Updated by Junxiao Shi about 9 years ago
      
    
    - Blocks Bug #3232: Inaccurate log message when changing FacePersistency added
 
      
      Updated by Junxiao Shi about 9 years ago
      
    
    This is necessary to implement #3232-12 procedure: when a client attempts to create a face but gets a conflict, the client needs to inspect the properties given in the response and decide whether to send an update.
      
      Updated by Junxiao Shi about 9 years ago
      
    
    - Status changed from New to In Progress
 
ndn::nfd::ControlResponse is an alias of ndn::mgmt::ControlResponse.
ControlResponse mismatches ControlCommand spec in that it expects exactly one TLV block in <body>, while the spec defines the <body> to be zero or more TLV blocks.
Then, to expose the <body>, ControlResponse should be given to Controller::CommandFailCallback.
This would require a backwards-incompatible change: even if I add a start overload to accept the old std::function<void(uint32_t code, const std::string& reason)> type, many callers are using bind([] (uint32_t) {}, _1) or similar when calling start, and they will get confused.
Thus, my plan is to:
- change 
CommandFailCallbacktofunction<void(const ControlResponse& resp)>; an internal instance ofControlResponsewill be used for situations like command timeout or response validation failure - declare 
DatasetFailCallbackas the oldCommandFailCallbackto use infetch 
      
      Updated by Alex Afanasyev about 9 years ago
      
    
    I'm ok having the breaking change to have only one CommandFailCallback as function<void(const ControlResponse& resp)>.
      
      Updated by Junxiao Shi about 9 years ago
      
    
    - % Done changed from 0 to 50
 
      
      Updated by Junxiao Shi about 9 years ago
      
    
    - Status changed from In Progress to Resolved
 - % Done changed from 50 to 100
 
NFD https://gerrit.named-data.net/3096
NLSR https://gerrit.named-data.net/3097
Other projects are unaffected https://travis-ci.org/yoursunny/ndn-cxx-breaks/builds/153031188