Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Opt: ALASBaseError (fixed) #4270

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 60 additions & 19 deletions module/exception.py
Original file line number Diff line number Diff line change
@@ -1,59 +1,100 @@
class CampaignEnd(Exception):
# ALASBaseException
# ├── ScriptError
# ├── ScriptEnd
# ├── EmulatorNotRunningError
# ├── RequestHumanTakeover
# ├── CampaignBaseException
# │ ├── CampaignEnd
# │ └── CampaignNameError
# ├── MapBaseException
# │ ├── MapDetectionError
# │ ├── MapWalkError
# │ └── MapEnemyMoved
# └── GameBaseException
# ├── GameStuckError
# ├── GameBugError
# ├── GameTooManyClickError
# ├── GameNotRunningError
# └── GamePageUnknownError


class ALASBaseException(Exception):
pass


class MapDetectionError(Exception):
class ScriptError(ALASBaseException):
# This is likely to be a mistake of developers, but sometimes a random issue
pass


class MapWalkError(Exception):
class ScriptEnd(ALASBaseException):
pass


class MapEnemyMoved(Exception):
class EmulatorNotRunningError(ALASBaseException):
pass


class CampaignNameError(Exception):
class RequestHumanTakeover(ALASBaseException):
# Request human takeover
# Alas is unable to handle such error, probably because of wrong settings.
def __init__(self, message='Request human takeover', *args):
super().__init__(message, *args)


# Campaign
class CampaignBaseException(ALASBaseException):
pass


class ScriptError(Exception):
# This is likely to be a mistake of developers, but sometimes a random issue
class CampaignEnd(CampaignBaseException):
pass


class ScriptEnd(Exception):
class CampaignNameError(CampaignBaseException):
pass


class GameStuckError(Exception):
# Map
class MapBaseException(ALASBaseException):
pass


class GameBugError(Exception):
# An error has occurred in Azur Lane game client. Alas is unable to handle.
# A restart should fix it.
class MapDetectionError(MapBaseException):
pass


class GameTooManyClickError(Exception):
class MapWalkError(MapBaseException):
pass


class EmulatorNotRunningError(Exception):
class MapEnemyMoved(MapBaseException):
pass


class GameNotRunningError(Exception):
# Game
class GameBaseException(ALASBaseException):
pass


class GamePageUnknownError(Exception):
class GameStuckError(GameBaseException):
pass


class RequestHumanTakeover(Exception):
# Request human takeover
# Alas is unable to handle such error, probably because of wrong settings.
class GameBugError(GameBaseException):
# An error has occurred in Azur Lane game client. Alas is unable to handle.
# A restart should fix it.
pass


class GameTooManyClickError(GameBaseException):
pass


class GameNotRunningError(GameBaseException):
pass


class GamePageUnknownError(GameBaseException):
def __init__(self, message='Game page unknown', *args):
super().__init__(message, *args)