mirror of
https://we.phorge.it/source/phorge.git
synced 2024-12-30 01:10:58 +01:00
"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
This commit is contained in:
parent
872845cc6c
commit
ed34402313
1 changed files with 15 additions and 9 deletions
|
@ -52,7 +52,10 @@ final class ConduitAPI_conduit_connect_Method extends ConduitAPIMethod {
|
|||
public function defineErrorTypes() {
|
||||
return array(
|
||||
"ERR-BAD-VERSION" =>
|
||||
"Client/server version mismatch. Update your client.",
|
||||
"Client/server version mismatch. Upgrade your server or downgrade ".
|
||||
"your client.",
|
||||
"NEW-ARC-VERSION" =>
|
||||
"Client/server version mismatch. Upgrade your client.",
|
||||
"ERR-UNKNOWN-CLIENT" =>
|
||||
"Client is unknown.",
|
||||
"ERR-INVALID-USER" =>
|
||||
|
@ -91,17 +94,20 @@ final class ConduitAPI_conduit_connect_Method extends ConduitAPIMethod {
|
|||
case $server_version:
|
||||
break;
|
||||
default:
|
||||
$ex = new ConduitException('ERR-BAD-VERSION');
|
||||
|
||||
if ($server_version < $client_version) {
|
||||
$upgrade = "Upgrade your Phabricator install.";
|
||||
} else {
|
||||
$upgrade = "Upgrade your 'arc' client.";
|
||||
}
|
||||
|
||||
$ex = new ConduitException('ERR-BAD-VERSION');
|
||||
$ex->setErrorDescription(
|
||||
"Your 'arc' client version is '{$client_version}', but this ".
|
||||
"server expects version '{$server_version}'. {$upgrade}");
|
||||
"Your 'arc' client version is '{$client_version}', which ".
|
||||
"is newer than the server version, '{$server_version}'. ".
|
||||
"Upgrade your Phabricator install.");
|
||||
} else {
|
||||
$ex = new ConduitException('NEW-ARC-VERSION');
|
||||
$ex->setErrorDescription(
|
||||
"A new version of arc is available! You need to upgrade ".
|
||||
"to connect to this server (you are running version ".
|
||||
"{$client_version}, the server is running version ".
|
||||
"{$server_version}).");
|
||||
}
|
||||
throw $ex;
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue