Another way to detect faults is by adding a so-called leaky bucket counter. With each error, the counter would get incremented, and after a certain threshold is reached (the bucket is full), a fault would get signaled and handled. In regular time intervals, the counter would get decreased (hence, leaky bucket). This way, the situation would only be considered a fault if many errors occurred in a short time period.
This pattern can be useful if in your case it's normal to sometimes have errors, for instance, if you're dealing with networking.
Now that we know how to detect faults, let's learn what to do once they happen.