Add call stack to RuntimeException based errors
This commit is contained in:
@@ -6,8 +6,11 @@ class SmnpException(Exception):
|
||||
def _title(self):
|
||||
pass
|
||||
|
||||
def _postMessage(self):
|
||||
return ""
|
||||
|
||||
def _position(self):
|
||||
return "" if self.pos is None else f" [line {self.pos[0]+1}, col {self.pos[1]+1}]"
|
||||
|
||||
def message(self):
|
||||
return f"{self._title()}{self._position()}:\n{self.msg}"
|
||||
return f"{self._title()}{self._position()}:\n{self.msg}\n{self._postMessage()}"
|
||||
|
||||
Reference in New Issue
Block a user