-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9a5e420
commit 40edf74
Showing
11 changed files
with
84 additions
and
71 deletions.
There are no files selected for viewing
29 changes: 29 additions & 0 deletions
29
WOTSTAT/res/scripts/client/gui/mods/wot_stat/common/exceptionSending.py
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from Event import Event | ||
from debug_utils import LOG_CURRENT_EXCEPTION | ||
from serverLogger import send_current_exception | ||
|
||
|
||
def with_exception_sending(f): | ||
def wrapper(*args, **kwargs): | ||
try: | ||
return f(*args, **kwargs) | ||
except: | ||
send_current_exception() | ||
LOG_CURRENT_EXCEPTION() | ||
|
||
return wrapper | ||
|
||
|
||
class SendExceptionEvent(Event): | ||
__slots__ = () | ||
|
||
def __init__(self, manager=None): | ||
super(SendExceptionEvent, self).__init__(manager) | ||
|
||
def __call__(self, *args, **kwargs): | ||
for delegate in self[:]: | ||
try: | ||
delegate(*args, **kwargs) | ||
except: | ||
send_current_exception() | ||
LOG_CURRENT_EXCEPTION() |
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
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
16 changes: 5 additions & 11 deletions
16
WOTSTAT/res/scripts/client/gui/mods/wot_stat/logger/eventLogger.py
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
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