title: Using 'boost::system::error_code' in C++
body: <p>I've got the following code:</p>
  
  <pre><code>boost::system::error_code errcode;
  return (boost::filesystem::create_directories(widePath, errcode));
  </code></pre>
  
  <p>When something goes wrong, I presume that <code>errcode</code> will indicate the nature of the error. However, I'm finding that when I know that something has gone wrong, <code>errcode</code> stays <code>0</code> which is not helpful.</p>
  
  <p>I also tried printing <code>errcode</code> to see if it might reveal something different:</p>
  
  <pre><code>boost::system::error_code errcode;
  boost::filesystem::create_directories(widePath, errcode);
  
  if (errcode == 0)
      return true;
  else
  {
      std::cout &lt;&lt; errcode;       
      return false;
  }
  </code></pre>
  
  <p>I intentionally caused an error by introducing invalid characters (<code>???</code>) into the folder name <code>widePath</code>. Now I get back <code>system:123</code> as a result. What does that mean?</p>