Skip to content

Commit ed34402

Browse files
author
epriestley
committed
"arc upgrade" (server changes)
Summary: When the server version is ahead of the client version, send a more exciting error!!! Test Plan: omg~~~ Reviewers: nh, Makinde, btrahan, jungejason Reviewed By: nh CC: aran Differential Revision: https://secure.phabricator.com/D2436
1 parent 872845c commit ed34402

File tree

1 file changed

+15
-9
lines changed

1 file changed

+15
-9
lines changed

src/applications/conduit/method/conduit/connect/ConduitAPI_conduit_connect_Method.php

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ public function defineReturnType() {
5252
public function defineErrorTypes() {
5353
return array(
5454
"ERR-BAD-VERSION" =>
55-
"Client/server version mismatch. Update your client.",
55+
"Client/server version mismatch. Upgrade your server or downgrade ".
56+
"your client.",
57+
"NEW-ARC-VERSION" =>
58+
"Client/server version mismatch. Upgrade your client.",
5659
"ERR-UNKNOWN-CLIENT" =>
5760
"Client is unknown.",
5861
"ERR-INVALID-USER" =>
@@ -91,17 +94,20 @@ protected function execute(ConduitAPIRequest $request) {
9194
case $server_version:
9295
break;
9396
default:
94-
$ex = new ConduitException('ERR-BAD-VERSION');
95-
9697
if ($server_version < $client_version) {
97-
$upgrade = "Upgrade your Phabricator install.";
98+
$ex = new ConduitException('ERR-BAD-VERSION');
99+
$ex->setErrorDescription(
100+
"Your 'arc' client version is '{$client_version}', which ".
101+
"is newer than the server version, '{$server_version}'. ".
102+
"Upgrade your Phabricator install.");
98103
} else {
99-
$upgrade = "Upgrade your 'arc' client.";
104+
$ex = new ConduitException('NEW-ARC-VERSION');
105+
$ex->setErrorDescription(
106+
"A new version of arc is available! You need to upgrade ".
107+
"to connect to this server (you are running version ".
108+
"{$client_version}, the server is running version ".
109+
"{$server_version}).");
100110
}
101-
102-
$ex->setErrorDescription(
103-
"Your 'arc' client version is '{$client_version}', but this ".
104-
"server expects version '{$server_version}'. {$upgrade}");
105111
throw $ex;
106112
}
107113
break;

0 commit comments

Comments
 (0)