Skip to content

Commit 4a99909

Browse files
authored
update errors (#357)
1 parent 3002dee commit 4a99909

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

erniebot/src/erniebot/errors.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@
3535
class EBError(Exception):
3636
"""Base exception class for the erniebot library."""
3737

38+
def __init__(self, message: Optional[Any] = None, *args, **kwargs):
39+
if message is None:
40+
message = str(self.__class__.__name__)
41+
message = message
42+
super().__init__(message, *args, **kwargs)
43+
3844

3945
class ArgumentNotFoundError(EBError):
4046
"""An argument was not found."""

0 commit comments

Comments
 (0)