-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from gamultong/enhancement/proper-error-msg
try catch 시 exception 제대로 메시지로 변환
- Loading branch information
Showing
10 changed files
with
70 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,15 @@ | ||
class InvalidTileException(Exception): | ||
msg: str = "invalid tile" | ||
def __init__(self, tile: dict): | ||
self.tile = tile | ||
|
||
def __str__(self): | ||
return f"invalid tile: {self.tile}" | ||
|
||
|
||
class InvalidDataLengthException(Exception): | ||
def __init__(self, expected: int, actual: int): | ||
self.msg = f"invalid data length. expected: {expected}, actual: {actual}" | ||
self.expected = expected | ||
self.actual = actual | ||
|
||
def __str__(self): | ||
return f"invalid data length. expected: {self.expected}, actual: {self.actual}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
class NoMatchingReceiverException(Exception): | ||
def __init__(self, event, *args): | ||
self.msg = f"no matching receiver for '{event}'" | ||
super().__init__(*args) | ||
def __init__(self, event: str): | ||
self.event = event | ||
|
||
def __str__(self): | ||
return f"no matching receiver for '{self.event}'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
class InvalidEventTypeException(Exception): | ||
def __init__(self, event, *args): | ||
self.msg = f"invalid event type: '{event}'" | ||
super().__init__(*args) | ||
def __init__(self, event: str): | ||
self.event = event | ||
|
||
def __str__(self): | ||
return f"invalid event type: '{self.event}'" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters