From d87fda8561c0fd8cc996e8ab8c67ed665353cdc5 Mon Sep 17 00:00:00 2001 From: epriestley Date: Sun, 10 Apr 2011 13:09:31 -0700 Subject: [PATCH] Improve workflow for missing certificates. --- scripts/arcanist.php | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/scripts/arcanist.php b/scripts/arcanist.php index e70f23ba..c9031ecb 100755 --- a/scripts/arcanist.php +++ b/scripts/arcanist.php @@ -190,17 +190,28 @@ try { )); } catch (ConduitClientException $ex) { if ($ex->getErrorCode() == 'ERR-NO-CERTIFICATE') { - $no_cert_msg = "You don't have certificate for ".$conduit_uri.".\n"; + $message = + "\n\n". + phutil_console_format( + "YOU NEED TO __INSTALL A CERTIFICATE__ TO LOGIN TO PHABRICATOR"). + "\n\n". + "The server '{$conduit_uri}' rejected your request:". + "\n\n". + $ex->getMessage(). + "\n\n"; $hosts_with_cert = ifilter($hosts_config, 'cert'); if (!empty($hosts_with_cert)) { - $no_cert_msg .= 'You have certificate(s) for '. - implode(array_keys($hosts_with_cert), ', ').".\n"; + if (count($hosts_with_cert) == 1) { + $message .= + "You currently have a certificate installed for one host:\n\n"; + } else { + $message .= + "You currently have certificates installed for these hosts:\n\n"; + } + $message .= ' '.implode("\n ", array_keys($hosts_with_cert)); + $message .= "\n"; } - $no_cert_msg .= 'Please refer to page http://www.phabricator.com'. - '/docs/phabricator/article/Installing_Arcanist_Certificates.html '. - 'for more info.'; - throw new ArcanistUsageException($no_cert_msg); - + throw new ArcanistUsageException($message); } else { throw $ex; } -- 2.43.0