Replace sys.exit() in non-main functions by exceptions

Also move all exceptions into one module
This commit is contained in:
Torsten Grote 2017-05-22 16:33:52 -03:00
parent a8420817cb
commit 1fcd8e63a3
No known key found for this signature in database
GPG key ID: 3E5F77D92CF891FF
17 changed files with 119 additions and 141 deletions

View file

@ -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':