diff --git a/.gitignore b/.gitignore index 85012e6..b0e2808 100644 --- a/.gitignore +++ b/.gitignore @@ -26,4 +26,6 @@ yarn-error.log* .yarn/ .mypy_cache/ -env/ \ No newline at end of file +env/ + +shittyserver.ini \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 03c3e1c..43ac0c7 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,11 +1,16 @@ aioice==0.6.18 aiortc==0.9.27 av==7.0.1 +blinker==1.4 +certifi==2020.4.5.1 cffi==1.14.0 +chardet==3.0.4 crc32c==2.0 cryptography==2.8 +idna==2.9 JACK-Client==0.5.2 jedi==0.15.2 +jsonpickle==1.3 mypy==0.770 mypy-extensions==0.4.3 netifaces==0.10.9 @@ -18,8 +23,11 @@ pyls==0.1.6 pyls-mypy==0.1.8 python-jsonrpc-server==0.3.4 python-language-server==0.31.9 +raygun4py==4.3.0 +requests==2.23.0 six==1.14.0 typed-ast==1.4.1 typing-extensions==3.7.4.2 ujson==1.35 +urllib3==1.25.8 websockets==8.1 diff --git a/server.py b/server.py index 373cb02..aef0cd5 100644 --- a/server.py +++ b/server.py @@ -10,7 +10,21 @@ import jack as Jack # type: ignore import os import re from datetime import datetime -from typing import Optional, Any +from typing import Optional, Any, Type +from types import TracebackType +import sys +from raygun4py import raygunprovider # type: ignore + +import configparser + +config = configparser.ConfigParser() +config.read("shittyserver.ini") + +def handle_exception(exc_type: Type[BaseException], exc_value: BaseException, exc_traceback: TracebackType) -> None: + cl = raygunprovider.RaygunSender(config["raygun"]["key"]) + cl.send_exception(exc_info=(exc_type, exc_value, exc_traceback)) + +sys.excepthook = handle_exception file_contents_ex = re.compile(r"^ws=\d$") @@ -211,6 +225,7 @@ class Session(object): self.connection_id = uuid.uuid4() self.connection_state = "HELLO" print(self.connection_id, "Connected") + # TODO Raygun user ID await websocket.send( json.dumps({"kind": "HELLO", "connectionId": str(self.connection_id)}) ) diff --git a/shittyserver.ini.example b/shittyserver.ini.example new file mode 100644 index 0000000..573ea08 --- /dev/null +++ b/shittyserver.ini.example @@ -0,0 +1,2 @@ +[raygun] +key = CHANGEME \ No newline at end of file