Browse Source

Merge "Convert add_remote to use GitReviewExceptions"

Jenkins 4 years ago
parent
commit
f3e623f115
1 changed files with 3 additions and 2 deletions
  1. 3
    2
      git_review/cmd.py

+ 3
- 2
git_review/cmd.py View File

@@ -359,7 +359,8 @@ def add_remote(scheme, hostname, port, project, remote):
359 359
         remote_url = make_remote_url(scheme, username, hostname, port, project)
360 360
         print("Trying again with %s" % remote_url)
361 361
         if not test_remote_url(remote_url):
362
-            raise Exception("Could not connect to gerrit at %s" % remote_url)
362
+            raise GitReviewException("Could not connect to gerrit at "
363
+                                     "%s" % remote_url)
363 364
         asked_for_username = True
364 365
 
365 366
     print("Creating a git remote called \"%s\" that maps to:" % remote)
@@ -368,7 +369,7 @@ def add_remote(scheme, hostname, port, project, remote):
368 369
     (status, remote_output) = run_command_status(cmd)
369 370
 
370 371
     if status != 0:
371
-        raise Exception("Error running %s" % cmd)
372
+        raise CommandFailed(status, remote_output, cmd, {})
372 373
 
373 374
     if asked_for_username:
374 375
         print()

Loading…
Cancel
Save