mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-21 16:52:31 -05:00
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:
@@ -11,7 +11,6 @@ import weakref
|
||||
import functools
|
||||
from collections import namedtuple, OrderedDict
|
||||
from datetime import datetime
|
||||
from enum import IntEnum
|
||||
from importlib.machinery import ModuleSpec
|
||||
from pathlib import Path
|
||||
from typing import (
|
||||
@@ -39,6 +38,7 @@ from discord.ext import commands as dpy_commands
|
||||
from discord.ext.commands import when_mentioned_or
|
||||
|
||||
from . import Config, i18n, commands, errors, drivers, modlog, bank
|
||||
from .cli import ExitCodes
|
||||
from .cog_manager import CogManager, CogManagerUI
|
||||
from .core_commands import Core
|
||||
from .data_manager import cog_data_path
|
||||
@@ -69,7 +69,7 @@ SHARED_API_TOKENS = "SHARED_API_TOKENS"
|
||||
|
||||
log = logging.getLogger("red")
|
||||
|
||||
__all__ = ("Red", "ExitCodes")
|
||||
__all__ = ("Red",)
|
||||
|
||||
NotMessage = namedtuple("NotMessage", "guild")
|
||||
|
||||
@@ -2190,11 +2190,3 @@ class Red(
|
||||
failed_cogs=failures["cog"],
|
||||
unhandled=failures["unhandled"],
|
||||
)
|
||||
|
||||
|
||||
class ExitCodes(IntEnum):
|
||||
# This needs to be an int enum to be used
|
||||
# with sys.exit
|
||||
CRITICAL = 1
|
||||
SHUTDOWN = 0
|
||||
RESTART = 26
|
||||
|
||||
Reference in New Issue
Block a user