mirror of
https://github.com/f-droid/fdroidserver.git
synced 2025-11-05 06:50:29 +03:00
Exception handling improvements
* Replace some prints with proper logging messages * Make VCSException as verbose as BuildException, including error output
This commit is contained in:
parent
c64aafaf42
commit
d132adf63c
4 changed files with 47 additions and 46 deletions
|
|
@ -1050,20 +1050,23 @@ def main():
|
|||
logfile.write(str(be))
|
||||
logfile.close()
|
||||
reason = str(be).split('\n', 1)[0] if options.verbose else str(be)
|
||||
print("Could not build app %s due to BuildException: %s" % (
|
||||
logging.error("Could not build app %s due to BuildException: %s" % (
|
||||
app['id'], reason))
|
||||
if options.stop:
|
||||
sys.exit(1)
|
||||
failed_apps[app['id']] = be
|
||||
wikilog = be.get_wikitext()
|
||||
except VCSException as vcse:
|
||||
print("VCS error while building app %s: %s" % (app['id'], vcse))
|
||||
reason = str(vcse).split('\n', 1)[0] if options.verbose else str(vcse)
|
||||
logging.error("VCS error while building app %s: %s" % (
|
||||
app['id'], reason))
|
||||
if options.stop:
|
||||
sys.exit(1)
|
||||
failed_apps[app['id']] = vcse
|
||||
wikilog = str(vcse)
|
||||
except Exception as e:
|
||||
print("Could not build app %s due to unknown error: %s" % (app['id'], traceback.format_exc()))
|
||||
logging.error("Could not build app %s due to unknown error: %s" % (
|
||||
app['id'], traceback.format_exc()))
|
||||
if options.stop:
|
||||
sys.exit(1)
|
||||
failed_apps[app['id']] = e
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue