Skip to content
Merged
Show file tree
Hide file tree
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
22 changes: 22 additions & 0 deletions src/core/bugcheck_error.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@


class BugCheckError:
@staticmethod
def UnkObjectDataType(objectType: type):
assert objectType is not None
assert type(objectType) is type
Expand All @@ -15,6 +16,7 @@ def UnkObjectDataType(objectType: type):
raise Exception(errMsg)

# --------------------------------------------------------------------
@staticmethod
def MultipleDefOfOptionIsFound(optName: str, count: int):
assert type(optName) is str
assert type(count) is int
Expand All @@ -27,6 +29,7 @@ def MultipleDefOfOptionIsFound(optName: str, count: int):
raise Exception(errMsg)

# --------------------------------------------------------------------
@staticmethod
def UnkOptObjectDataType(optName: str, optDataType: type):
assert type(optName) is str
assert type(optDataType) is type
Expand All @@ -39,6 +42,7 @@ def UnkOptObjectDataType(optName: str, optDataType: type):
raise Exception(errMsg)

# --------------------------------------------------------------------
@staticmethod
def MultipleDefOfFileIsFound(fileName: str, count: int):
assert type(fileName) is str
assert type(count) is int
Expand All @@ -51,6 +55,7 @@ def MultipleDefOfFileIsFound(fileName: str, count: int):
raise Exception(errMsg)

# --------------------------------------------------------------------
@staticmethod
def UnkFileObjectDataType(fileName: str, fileDataType: type):
assert type(fileName) is str
assert type(fileDataType) is type
Expand All @@ -61,6 +66,7 @@ def UnkFileObjectDataType(fileName: str, fileDataType: type):
raise Exception(errMsg)

# --------------------------------------------------------------------
@staticmethod
def UnkFileDataStatus(filePath: str, fileStatus: any):
assert type(filePath) is str
assert fileStatus is not None
Expand All @@ -71,6 +77,7 @@ def UnkFileDataStatus(filePath: str, fileStatus: any):
raise Exception(errMsg)

# --------------------------------------------------------------------
@staticmethod
def FileIsNotFoundInIndex(fileKey: str, filePath: str):
assert type(fileKey) is str
assert type(filePath) is str
Expand All @@ -81,35 +88,41 @@ def FileIsNotFoundInIndex(fileKey: str, filePath: str):
raise Exception(errMsg)

# --------------------------------------------------------------------
@staticmethod
def OptionIsNotFoundInIndex(optName: str):
assert type(optName) is str

errMsg = "[BUG CHECK] Option [{0}] is not found in index.".format(optName)
raise Exception(errMsg)

# --------------------------------------------------------------------
@staticmethod
def OptionIsNotFoundInFileLine(optName: str):
assert type(optName) is str

errMsg = "[BUG CHECK] Option [{0}] is not found in file line.".format(optName)
raise Exception(errMsg)

# --------------------------------------------------------------------
@staticmethod
def CommentIsNotFoundInFileLine():
errMsg = "[BUG CHECK] Comment is not found in file line."
raise Exception(errMsg)

# --------------------------------------------------------------------
@staticmethod
def IncludeIsNotFoundInFileLine():
errMsg = "[BUG CHECK] Include is not found in file line."
raise Exception(errMsg)

# --------------------------------------------------------------------
@staticmethod
def FileLineIsNotFoundInFile():
errMsg = "[BUG CHECK] FileLine is not found in file."
raise Exception(errMsg)

# --------------------------------------------------------------------
@staticmethod
def OptionHandlerToPrepareSetValueIsNotDefined(name: str):
assert type(name) is str

Expand All @@ -119,6 +132,7 @@ def OptionHandlerToPrepareSetValueIsNotDefined(name: str):
raise Exception(errMsg)

# --------------------------------------------------------------------
@staticmethod
def OptionHandlerToPrepareGetValueIsNotDefined(name: str):
assert type(name) is str

Expand All @@ -128,6 +142,7 @@ def OptionHandlerToPrepareGetValueIsNotDefined(name: str):
raise Exception(errMsg)

# --------------------------------------------------------------------
@staticmethod
def OptionHandlerToPrepareSetValueItemIsNotDefined(name: str):
assert type(name) is str

Expand All @@ -137,6 +152,7 @@ def OptionHandlerToPrepareSetValueItemIsNotDefined(name: str):
raise Exception(errMsg)

# --------------------------------------------------------------------
@staticmethod
def OptionHandlerToSetValueIsNotDefined(name: str):
assert type(name) is str

Expand All @@ -146,6 +162,7 @@ def OptionHandlerToSetValueIsNotDefined(name: str):
raise Exception(errMsg)

# --------------------------------------------------------------------
@staticmethod
def OptionHandlerToGetValueIsNotDefined(name: str):
assert type(name) is str

Expand All @@ -155,6 +172,7 @@ def OptionHandlerToGetValueIsNotDefined(name: str):
raise Exception(errMsg)

# --------------------------------------------------------------------
@staticmethod
def OptionHandlerToAddOptionIsNotDefined(name: str):
assert type(name) is str

Expand All @@ -166,6 +184,7 @@ def OptionHandlerToAddOptionIsNotDefined(name: str):
raise Exception(errMsg)

# --------------------------------------------------------------------
@staticmethod
def OptionHandlerToSetValueItemIsNotDefined(name: str):
assert type(name) is str

Expand All @@ -177,6 +196,7 @@ def OptionHandlerToSetValueItemIsNotDefined(name: str):
raise Exception(errMsg)

# --------------------------------------------------------------------
@staticmethod
def OptionHandlerToWriteIsNotDefined(name: str):
assert type(name) is str

Expand All @@ -186,6 +206,7 @@ def OptionHandlerToWriteIsNotDefined(name: str):
raise Exception(errMsg)

# --------------------------------------------------------------------
@staticmethod
def UnexpectedSituation(bugcheckSrc: str, bugcheckPoint: str, explain: str):
assert type(bugcheckSrc) is str
assert type(bugcheckPoint) is str
Expand All @@ -204,6 +225,7 @@ def UnexpectedSituation(bugcheckSrc: str, bugcheckPoint: str, explain: str):
raise Exception(errMsg)

# --------------------------------------------------------------------
@staticmethod
def UnknownOptionValueType(optionName: str, typeOfOptionValue: type):
assert type(optionName) is str
assert optionName != ""
Expand Down
Loading