-
-
Notifications
You must be signed in to change notification settings - Fork 70
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
Showing
8 changed files
with
20 additions
and
18 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
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
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,7 @@ | ||
import string | ||
import random | ||
|
||
__version__ = '2.6.1' | ||
__version__ = '2.7.0' | ||
__license__ = 'GPLv3' | ||
__copyright__ = '2019, Paweł Jastrzębski <[email protected]>' | ||
__docformat__ = 'restructuredtext en' | ||
|
@@ -10,22 +10,26 @@ | |
def retry(custom_error=False): | ||
def wraps(func): | ||
def inner(*args, **kwargs): | ||
description = None | ||
for i in range(3): | ||
# noinspection PyBroadException | ||
try: | ||
result = func(*args, **kwargs) | ||
except KeyboardInterrupt: | ||
raise | ||
except Exception: | ||
except Exception as e: | ||
description = e | ||
continue | ||
else: | ||
return result | ||
else: | ||
if custom_error: | ||
raise RuntimeError(custom_error) | ||
else: | ||
raise RuntimeError('Failed to parse addon data. There is some issue with the website or this addon ' | ||
'don\'t have release for your client version.') | ||
if description: | ||
raise RuntimeError(f'Failed to parse addon data: {description}') | ||
else: | ||
raise RuntimeError('Unknown error during parsing addon data. ' | ||
'There may be some issue with the website.') | ||
return inner | ||
return wraps | ||
|
||
|
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