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

Unified Diff: gclient.py

Issue 2866017: Make the exception user-friendly (Closed)
Patch Set: Created 10 years, 6 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.py
diff --git a/gclient.py b/gclient.py
index 55305bd8c4b2493766dfa995b9ad735a50613da0..3a5a669bb35be80a1196a054342f29235136090b 100644
--- a/gclient.py
+++ b/gclient.py
@@ -450,11 +450,15 @@ solutions = [
# Raise a new exception with the human readable message:
raise gclient_utils.Error('\n'.join(error_message))
for s in config_dict.get('solutions', []):
- self.dependencies.append(Dependency(
- self, s['name'], s['url'],
- s.get('safesync_url', None),
- s.get('custom_deps', {}),
- s.get('custom_vars', {})))
+ try:
+ self.dependencies.append(Dependency(
+ self, s['name'], s['url'],
+ s.get('safesync_url', None),
+ s.get('custom_deps', {}),
+ s.get('custom_vars', {})))
+ except KeyError:
+ raise gclient_utils.Error('Invalid .gclient file. Solution is '
+ 'incomplete: %s' % s)
# .gclient can have hooks.
self.deps_hooks = config_dict.get('hooks', [])
« 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