Catch remote forking errors and display them
authorChristian Weiske <cweiske@cweiske.de>
Tue, 19 Nov 2013 17:16:12 +0000 (18:16 +0100)
committerChristian Weiske <cweiske@cweiske.de>
Tue, 19 Nov 2013 17:16:12 +0000 (18:16 +0100)
www/fork-remote.php

index f34a232..4d9ca34 100644 (file)
@@ -18,8 +18,12 @@ if (isset($_POST['remote_url'])) {
             $fr->setUrl($_POST['orig_url']);
         }
         $forker = new Forker();
             $fr->setUrl($_POST['orig_url']);
         }
         $forker = new Forker();
-        $new    = $forker->forkRemote($gitUrl, $fr->getUrl());
-        redirect($new->getLink('display', null, true));
+        try {
+            $new = $forker->forkRemote($gitUrl, $fr->getUrl());
+            redirect($new->getLink('display', null, true));
+        } catch (\Exception $e) {
+            $error = $e->getMessage();
+        }
     } else {
         //multiple urls found
         $urls = $fr->getGitUrls();
     } else {
         //multiple urls found
         $urls = $fr->getGitUrls();