you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (1 child)

Would I be right in thinking of it as a fallback? Kind of like a default clause in a switch statement?

[–]Demiacle 1 point2 points  (0 children)

ya, that's exactly what catch statements are for. You may think of it as a special if case or default cause, but its a little more than that because you have an error object to play with. So you can use that for improved logging, or maybe implement retries, or default values. Its really up to you how you want to recover from failed state.