mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 06:50:29 +03:00
Replace sys.exit() in non-main functions by exceptions
Also move all exceptions into one module
This commit is contained in:
parent
a8420817cb
commit
1fcd8e63a3
17 changed files with 119 additions and 141 deletions
|
|
@ -36,20 +36,12 @@ except ImportError:
|
|||
YamlLoader = Loader
|
||||
|
||||
import fdroidserver.common
|
||||
from fdroidserver.exception import MetaDataException
|
||||
|
||||
srclibs = None
|
||||
warnings_action = None
|
||||
|
||||
|
||||
class MetaDataException(Exception):
|
||||
|
||||
def __init__(self, value):
|
||||
self.value = value
|
||||
|
||||
def __str__(self):
|
||||
return self.value
|
||||
|
||||
|
||||
def warn_or_exception(value):
|
||||
'''output warning or Exception depending on -W'''
|
||||
if warnings_action == 'ignore':
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue