title: rules to define an error code?
body: <p>I'm working on a project in which I need to return error codes in case work failed.
  But which is the 'rule' for doing this?</p>
  
  <p>For example:</p>
  
  <pre><code>if(tryDoUpload() == false) {
    //upload failed
   int UPLOAD_FAILED = 0x0;
  }
  </code></pre>
  
  <p>see <code>0x0</code>, is there a pattern to set this error code or can I set any?</p>
  
  <p>I hope this is clear. </p>