Summary
This chapter introduced us to the various failure modes of our large scale JavaScript applications. The fail-fast mode means that once we detect a problem, we stop everything right away, in an effort to prevent further damage. This is often desirable when a critical component of our application fails.
Fault tolerance is an architectural property that means the system is capable of detecting errors, and preventing them from disrupting regular operation. In a JavaScript context, this usually means catching exceptions and preventing them from disrupting other components. There're several ways that a component can recover from an error, including retrying an operation, or restarting itself, to flush out bad states.
Error handling adds to the complexity of our code, and has performance implications if not handled with care. To avoid these, we have to aim for simple components that don't manipulate state, and avoid excessive exception handling. Error messages can help both programmers and...