-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use a wrapper to mask benign exceptions from lsp-devtools
- Loading branch information
Showing
2 changed files
with
50 additions
and
4 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
"""This file wraps the lsp-devtools entry point that is used for recording LSP message | ||
into a replay file. | ||
Its purpose is to catch the CancelledError exception which occurs systematically in the | ||
nominal termination of the lsp-devtools agent. These exceptions appear even in | ||
successful tests and cause confusion, hence creating this wrapper to mask them. | ||
""" | ||
|
||
import asyncio | ||
import sys | ||
from lsp_devtools.cli import main | ||
|
||
if __name__ == "__main__": | ||
try: | ||
sys.exit(main()) | ||
except asyncio.exceptions.CancelledError: | ||
# Silence these exceptions | ||
sys.exit(1) |
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