projects
/
git-mirror.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3311042
)
slightly more informative error messages
author
Ralf Jung
<post@ralfj.de>
Sun, 7 Feb 2016 20:10:27 +0000
(21:10 +0100)
committer
Ralf Jung
<post@ralfj.de>
Sun, 7 Feb 2016 20:10:27 +0000
(21:10 +0100)
githook.py
patch
|
blob
|
history
webhook-core.py
patch
|
blob
|
history
diff --git
a/githook.py
b/githook.py
index a503a470eee76de88b31c2c5442d139b47f1c441..fcfb392bc662984c1837f2d7bfe28d8be1f829e7 100755
(executable)
--- a/
githook.py
+++ b/
githook.py
@@
-35,7
+35,7
@@
if __name__ == "__main__":
# find the repository we are dealing with
reponame = find_repo_by_directory(repos, os.getcwd())
if reponame is None or reponame not in repos:
# find the repository we are dealing with
reponame = find_repo_by_directory(repos, os.getcwd())
if reponame is None or reponame not in repos:
- raise Exception("Unknown repository
."
)
+ raise Exception("Unknown repository
{}.".format(reponame)
)
# now sync this repository
repo = repos[reponame]
# now sync this repository
repo = repos[reponame]
@@
-50,5
+50,5
@@
if __name__ == "__main__":
if repo is not None:
repo.mail_owner("There was a problem running the git-mirror git hook:\n\n{}".format(traceback.format_exc()))
# do not print all the details
if repo is not None:
repo.mail_owner("There was a problem running the git-mirror git hook:\n\n{}".format(traceback.format_exc()))
# do not print all the details
- sys.stderr.write("We have a problem:\n{}".format('\n'.join(traceback.format_exception_only(type(e), e))))
+ sys.stderr.write("
git-mirror:
We have a problem:\n{}".format('\n'.join(traceback.format_exception_only(type(e), e))))
diff --git
a/webhook-core.py
b/webhook-core.py
index 83cb03edd31c1ebd8c135ac4c4ea8c1f32b68df2..90432c82557839030718dfe899b1a3ef16ebb75c 100755
(executable)
--- a/
webhook-core.py
+++ b/
webhook-core.py
@@
-51,7
+51,7
@@
if __name__ == "__main__":
githubEvent = sys.argv[2]
githubSignature = sys.argv[3]
if reponame not in repos:
githubEvent = sys.argv[2]
githubSignature = sys.argv[3]
if reponame not in repos:
- raise Exception("Repository
missing or not found."
)
+ raise Exception("Repository
{} missing or not found.".format(reponame)
)
repo = repos[reponame]
# now sync this repository
repo = repos[reponame]
# now sync this repository
@@
-91,4
+91,4
@@
if __name__ == "__main__":
print("Status: 500 Internal Server Error")
print("Content-Type: text/plain")
print()
print("Status: 500 Internal Server Error")
print("Content-Type: text/plain")
print()
- print("We have a problem:\n{}".format('\n'.join(traceback.format_exception_only(type(e), e))))
+ print("
git-mirror:
We have a problem:\n{}".format('\n'.join(traceback.format_exception_only(type(e), e))))