Looking for suggestions/best practices on managing error codes and messages in a multi-tiered applications. Specifically things like:
- Where should error codes be defined? Enum? Class?
- How are error messages or further details associated with the error codes? resource files? attributes on enum values, etc.?
- If you have a multi-tier application consisting of DAL, BLL, UI, and Common projects for example, should there be a single giant list of codes for all tiers, or are the codes extensible by project/tier?
Update: Important to mention that I can't rely solely on Exceptions and custom Exception types for error reporting, as some clients for this application will be via web services (SOAP & REST)
Any suggestions welcome!