From: Christian Weiske Date: Tue, 19 Nov 2013 17:16:12 +0000 (+0100) Subject: Catch remote forking errors and display them X-Git-Tag: v0.4.0~67 X-Git-Url: https://git.cweiske.de/phorkie.git/commitdiff_plain/83a87530ac660a7d71f3d86ef93dc896d878696f?ds=sidebyside Catch remote forking errors and display them --- diff --git a/www/fork-remote.php b/www/fork-remote.php index f34a232..4d9ca34 100644 --- a/www/fork-remote.php +++ b/www/fork-remote.php @@ -18,8 +18,12 @@ if (isset($_POST['remote_url'])) { $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();