mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 15:00:30 +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
|
|
@ -35,12 +35,12 @@ import json
|
|||
import logging
|
||||
import requests
|
||||
import shutil
|
||||
import sys
|
||||
import tempfile
|
||||
import xml.dom.minidom
|
||||
import zipfile
|
||||
from argparse import ArgumentParser
|
||||
|
||||
from .exception import FDroidException
|
||||
from . import common
|
||||
from . import server
|
||||
|
||||
|
|
@ -166,8 +166,8 @@ def main():
|
|||
logging.getLogger("urllib3").setLevel(logging.WARNING)
|
||||
|
||||
if not os.path.exists(options.git_repo):
|
||||
logging.error('"' + options.git_repo + '/" does not exist! Create it, or use --git-repo')
|
||||
sys.exit(1)
|
||||
raise FDroidException(
|
||||
'"%s" does not exist! Create it, or use --git-repo' % options.git_repo)
|
||||
|
||||
session = requests.Session()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue