O'Reilly logo

JavaScript at Scale by Adam Boduch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Failure recovery

In the preceding section, we started to think about fault tolerance in our frontend code. That is, our application needs to survive the loss of a failed component—at least in the short term. But what if there are certain kinds of errors that we can recover from? So instead of shutting down the component after detecting the error, we would take some alternative course of action; one that would still satisfy the user.

In this section, we'll look at the various ways our components can recover from failed operations. For example, we can retry an operation, or we could flush out the bad state of a component by restarting it. Sometimes, it makes sense to get input from the user on how they wish to proceed during a recovery effort.

Retrying ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required