title: Best Practice - NSError domains and codes for your own project/app
body: <p>There is a <a href="https://stackoverflow.com/questions/1779034/nserror-domains-custom-domains-conventions-and-best-practices">previous SO post</a> regarding setting up error domains for your own frameworks, but what is the best practice regarding setting up error domains and custom error codes <em>for your own project/app</em>?</p>
  
  <p>For example, supposing you're working on a Core Data-intensive app with lots of validations, should you just stick with the "off the shelf" Core Data error codes (such as <code>NSManagedObjectValidationError</code> from <code>CoreDataErrors.h</code>) or should you create your own <code>MyAppErrors.h</code> and define errors with more specificity (i.e., <code>MyAppValidationErrorInvalidCombinationOfLimbs</code>?</p>
  
  <p>Creating a custom error domain and set of error codes could significantly disambiguate your code, but is it too much overhead to maintain and does one have to worry about error code numbering conflicts?  Or are there other concerns here?</p>