Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Unified Diff: gclient_utils.py

Issue 15792004: Add job prefix to error messages. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: tweak Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient_utils.py
diff --git a/gclient_utils.py b/gclient_utils.py
index 54d4e0ecf5ce374556006a502b0f05a3fd471361..d86f23c1d140466ec7acd435907811f23ba4b9b4 100644
--- a/gclient_utils.py
+++ b/gclient_utils.py
@@ -22,8 +22,11 @@ import subprocess2
class Error(Exception):
"""gclient exception class."""
- pass
-
+ def __init__(self, msg, *args, **kwargs):
+ index = getattr(threading.currentThread(), 'index', 0)
+ if index:
+ msg = '\n'.join('%d> %s' % (index, l) for l in msg.splitlines())
+ super(Error, self).__init__(msg, *args, **kwargs)
def SplitUrlRevision(url):
"""Splits url and returns a two-tuple: url, rev"""
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698