Catch unhandled async LSP handlers errors
Problem
Uncaught errors/rejected promises on the handler level can kill the LS process
Solution
Simulate the issue by throwing errors from different parts of the message handler (and other handlers if we use any).
Devise a mechanism that would prevent these errors from going all the way to the connection
(some catch wrapper or other mechanism).
Original description:
As shown by !195 (merged) as we get more contributors it is easy to miss a catch here or there. In some cases that causes things to hang in others it causes the language server to crash #129 (closed). We should guard handlers with a try/catch utility function and consider a follow-up issue to lint these automatically through a custom eslint rule.