Use different exit codes for critical errors vs configuration errors (#5674)

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
This commit is contained in:
Jakub Kuczys
2022-12-25 22:27:07 +01:00
committed by GitHub
parent 0e58897bfc
commit e8c044a9bf
9 changed files with 60 additions and 44 deletions

View File

@@ -8,6 +8,8 @@ from aiohttp_json_rpc.rpc import JsonRpcMethod
import logging
from redbot.core.cli import ExitCodes
log = logging.getLogger("red.rpc")
__all__ = ["RPC", "RPCMixin", "get_name"]
@@ -89,7 +91,7 @@ class RPC:
)
except Exception as exc:
log.exception("RPC setup failure", exc_info=exc)
sys.exit(1)
sys.exit(ExitCodes.CRITICAL)
else:
await self._site.start()
log.debug("Created RPC server listener on port %s", port)