title: Using boost::asio::write() boost::system::error_code never gets set
body: <p>When using the boost::asio::write() variation with an error object, the error doesn't get set, but instead an exception is getting thrown. Perhaps I misunderstood, uI thought this version would set the error, and NOT throw an exception:</p>
  
  <pre><code>try{
  
      boost::system::error_code error;
  
      size_t iBytesWrit = boost::asio::write(
          *a_socket_ptr,boost::asio::buffer(a_response.getdata()),
          boost::asio::transfer_all(),
          error);
  
          (A)
          if(error)print error...
  
  
  }
  catch(std::exception &amp;e){
  
      (B)
      log error...
  }
  </code></pre>
  
  <p>if I cause an error on write by shutting down the client-side of the socket, an exception is thrown
  here ( B happens, not A). boost::system::error_code is not set at all. What stupid thing am I missing?</p>
  
  <p>This is tcp and synchronous.</p>