Overview of Error Management
Let’s learn about error management in clean architecture.
Overview
In every software project, a large part of the code is dedicated to error management. This part of the code has to be infallible. Yet, more often than not, we find that we’ve left out cases that give errors, or we’ve provided a condition that we thought would never fail but does.
In clean architecture, the main process is the creation of use cases and their execution. As we can expect, this is also the main source of errors. So, the use cases layer is where we have to implement error management. This isn’t to say that errors can’t also come from the domain models layer. However, since those models are created by the use cases, the errors that aren’t managed by the models themselves are automatically treated as errors of the use cases.
Get hands-on with 1400+ tech skills courses.