This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const mockClient = {}; | |
// The Promise model groups unintentional errors with errors into the same | |
// try/catch mechanism. | |
// | |
// In most typed languages this is fine because the catch clause gives you some | |
// flexibility to catch only the errors you are interested in. JS gives you a | |
// catch all, which makes it hard to distinguish the errors. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
const mockClient = {}; | |
// The Callback Error Model allows unintentional errors to bubble up and crash | |
// the process. | |
// | |
// With the Callback Error Model, it is impossible to catch these errors | |
// because try/catch doesn't work over subsequent ticks of the event loop. | |
// |