crowdin: Improve error handling when push fails
* Right now there is only a barely noticeable "Failed" at the end of
each block that actually fails - too few info to miss
* Catch the actual exception and prepend it so you can't miss it anymore
* Also need to return in that case, otherwise we get _COMMITS_CREATED set
despite of an error
Change-Id: I8475e44169a85953082b1a4726ac18b601a6fd23
diff --git a/crowdin_sync.py b/crowdin_sync.py
index ecbc76e..a97eb06 100755
--- a/crowdin_sync.py
+++ b/crowdin_sync.py
@@ -280,8 +280,9 @@
repo.git.push(f'ssh://{username}@review.lineageos.org:29418/{name}',
f'HEAD:refs/for/{branch}%topic=translation')
print('Success')
- except:
- print('Failed', file=sys.stderr)
+ except Exception as e:
+ print(e, '\nFailed to push!', file=sys.stderr)
+ return
_COMMITS_CREATED = True