Weekly Dev Tips
Prefer Custom Exceptions
- Autor: Vários
- Narrador: Vários
- Editor: Podcast
- Duración: 0:11:38
- Mas informaciones
Informações:
Sinopsis
Prefer Custom Exceptions Low level built-in exception types offer little context and are much harder to diagnose than custom exceptions that can use the language of the model or application. Sponsor - DevIQ Thanks to DevIQ for sponsoring this episode! Check out their list of available courses and how-to videos. Show Notes / Transcript Given the choice, avoid throwing basic exception types like Exception, ApplicationException, and SystemException from your application code. Instead, create your own exception types that inherit from System.Exception. You can also catch common but difficult-to-diagnose exceptions like NullReferenceException and wrap them in your own application-specific exceptions. You should think about your application exceptions as being part of your domain model. They represent known bad states that your system can find itself in or having to deal with. You should be able to use your ubiquitous language to discuss these exceptions and their sources within the system with your non-technical d