1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-18 19:40:55 +01:00

Rename AphrontQueryException subclasses

Summary: Ref T5655. Depends on D10149.

Test Plan: Ran `arc unit`

Reviewers: epriestley, #blessed_reviewers

Reviewed By: epriestley, #blessed_reviewers

Subscribers: epriestley, Korvin, hach-que

Maniphest Tasks: T5655

Differential Revision: https://secure.phabricator.com/D10150
This commit is contained in:
Joshua Spence 2014-08-06 07:51:21 +10:00
parent 21dca29c5f
commit 8fd098329b
29 changed files with 35 additions and 35 deletions

View file

@ -58,7 +58,7 @@ while ($update) {
$project->getID());
unset($update[$key]);
echo "okay.\n";
} catch (AphrontQueryDuplicateKeyException $ex) {
} catch (AphrontDuplicateKeyQueryException $ex) {
echo "failed, will retry.\n";
}
}

View file

@ -187,7 +187,7 @@ foreach ($rows as $row) {
try {
$saved->save();
} catch (AphrontQueryDuplicateKeyException $ex) {
} catch (AphrontDuplicateKeyQueryException $ex) {
// Ignore this, we just have duplicate saved queries.
}

View file

@ -113,11 +113,11 @@ final class PhabricatorInfrastructureTestCase extends PhabricatorTestCase {
$caught = null;
try {
qsprintf($conn_r, 'SELECT %s', $gclef);
} catch (AphrontQueryCharacterSetException $ex) {
} catch (AphrontCharacterSetQueryException $ex) {
$caught = $ex;
}
$this->assertTrue($caught instanceof AphrontQueryCharacterSetException);
$this->assertTrue($caught instanceof AphrontCharacterSetQueryException);
}
}

View file

@ -250,7 +250,7 @@ class AphrontDefaultApplicationConfiguration
$class = get_class($ex);
$message = $ex->getMessage();
if ($ex instanceof AphrontQuerySchemaException) {
if ($ex instanceof AphrontSchemaQueryException) {
$message .=
"\n\n".
"NOTE: This usually indicates that the MySQL schema has not been ".

View file

@ -304,7 +304,7 @@ final class PhabricatorAuthRegisterController
}
return $this->loginUser($user);
} catch (AphrontQueryDuplicateKeyException $exception) {
} catch (AphrontDuplicateKeyQueryException $exception) {
$same_username = id(new PhabricatorUser())->loadOneWhere(
'userName = %s',
$user->getUserName());

View file

@ -30,7 +30,7 @@ final class PhabricatorSetupCheckDatabase extends PhabricatorSetupCheck {
try {
queryfx($conn_raw, 'SELECT 1');
} catch (AphrontQueryConnectionException $ex) {
} catch (AphrontConnectionQueryException $ex) {
$message = pht(
"Unable to connect to MySQL!\n\n".
"%s\n\n".

View file

@ -16,7 +16,7 @@ final class DifferentialDraft extends DifferentialDAO {
->setAuthorPHID($author_phid)
->setDraftKey($draft_key)
->save();
} catch (AphrontQueryDuplicateKeyException $ex) {
} catch (AphrontDuplicateKeyQueryException $ex) {
// no worries
}
}

View file

@ -333,7 +333,7 @@ final class HeraldRuleController extends HeraldController {
$rule->logEdit($request->getUser()->getPHID(), $edit_action);
$rule->saveTransaction();
} catch (AphrontQueryDuplicateKeyException $ex) {
} catch (AphrontDuplicateKeyQueryException $ex) {
$e_name = pht('Not Unique');
$errors[] = pht('Rule name is not unique. Choose a unique name.');
}

View file

@ -125,7 +125,7 @@ final class PhabricatorMacroEditController extends PhabricatorMacroController {
$view_uri = $this->getApplicationURI('/view/'.$original->getID().'/');
return id(new AphrontRedirectResponse())->setURI($view_uri);
} catch (AphrontQueryDuplicateKeyException $ex) {
} catch (AphrontDuplicateKeyQueryException $ex) {
throw $ex;
$errors[] = pht('Macro name is not unique!');
$e_name = pht('Duplicate');

View file

@ -67,7 +67,7 @@ final class PhabricatorMailingListsEditController
$list->save();
return id(new AphrontRedirectResponse())
->setURI($this->getApplicationURI());
} catch (AphrontQueryDuplicateKeyException $ex) {
} catch (AphrontDuplicateKeyQueryException $ex) {
$e_email = pht('Duplicate');
$errors[] = pht('Another mailing list already uses that address.');
}

View file

@ -92,7 +92,7 @@ final class PhabricatorOwnersEditController
$package->save();
return id(new AphrontRedirectResponse())
->setURI('/owners/package/'.$package->getID().'/');
} catch (AphrontQueryDuplicateKeyException $ex) {
} catch (AphrontDuplicateKeyQueryException $ex) {
$e_name = pht('Duplicate');
$errors[] = pht('Package name must be unique.');
}

View file

@ -104,7 +104,7 @@ final class PhabricatorPeopleNewController
$response = id(new AphrontRedirectResponse())
->setURI('/p/'.$user->getUsername().'/');
return $response;
} catch (AphrontQueryDuplicateKeyException $ex) {
} catch (AphrontDuplicateKeyQueryException $ex) {
$errors[] = pht('Username and email must be unique.');
$same_username = id(new PhabricatorUser())

View file

@ -56,7 +56,7 @@ final class PhabricatorPeopleRenameController
$new_uri = '/p/'.$v_username.'/';
return id(new AphrontRedirectResponse())->setURI($new_uri);
} catch (AphrontQueryDuplicateKeyException $ex) {
} catch (AphrontDuplicateKeyQueryException $ex) {
$e_username = pht('Not Unique');
$errors[] = pht('Another user already has that username.');
}

View file

@ -54,7 +54,7 @@ final class PhabricatorUserEditor extends PhabricatorEditor {
$user->save();
$email->setUserPHID($user->getPHID());
$email->save();
} catch (AphrontQueryDuplicateKeyException $ex) {
} catch (AphrontDuplicateKeyQueryException $ex) {
// We might have written the user but failed to write the email; if
// so, erase the IDs we attached.
$user->setID(null);
@ -155,7 +155,7 @@ final class PhabricatorUserEditor extends PhabricatorEditor {
try {
$user->save();
} catch (AphrontQueryDuplicateKeyException $ex) {
} catch (AphrontDuplicateKeyQueryException $ex) {
$user->setUsername($old_username);
$user->killTransaction();
throw $ex;
@ -365,7 +365,7 @@ final class PhabricatorUserEditor extends PhabricatorEditor {
try {
$email->save();
} catch (AphrontQueryDuplicateKeyException $ex) {
} catch (AphrontDuplicateKeyQueryException $ex) {
$user->endWriteLocking();
$user->killTransaction();

View file

@ -25,7 +25,7 @@ final class PhabricatorPeopleTestDataGenerator
->createNewUser($user, $email_object);
return $user;
} catch (AphrontQueryDuplicateKeyException $ex) {
} catch (AphrontDuplicateKeyQueryException $ex) {
}
}
}

View file

@ -96,7 +96,7 @@ final class PhameBlogEditController
$blog->save();
return id(new AphrontRedirectResponse())
->setURI($this->getApplicationURI('blog/view/'.$blog->getID().'/'));
} catch (AphrontQueryDuplicateKeyException $ex) {
} catch (AphrontDuplicateKeyQueryException $ex) {
$errors[] = pht('Domain must be unique.');
$e_custom_domain = pht('Not Unique');
}

View file

@ -82,7 +82,7 @@ final class PhamePostEditController extends PhameController {
$uri = $this->getApplicationURI('/post/view/'.$post->getID().'/');
return id(new AphrontRedirectResponse())->setURI($uri);
} catch (AphrontQueryDuplicateKeyException $e) {
} catch (AphrontDuplicateKeyQueryException $e) {
$e_phame_title = pht('Not Unique');
$errors[] = pht('Another post already uses this slug. '.
'Each post must have a unique slug.');

View file

@ -92,7 +92,7 @@ final class PhluxEditController extends PhluxController {
$editor->applyTransactions($var, $xactions);
$view_uri = $this->getApplicationURI('/view/'.$key.'/');
return id(new AphrontRedirectResponse())->setURI($view_uri);
} catch (AphrontQueryDuplicateKeyException $ex) {
} catch (AphrontDuplicateKeyQueryException $ex) {
$e_key = pht('Not Unique');
$errors[] = pht('Variable key must be unique.');
}

View file

@ -52,7 +52,7 @@ final class PhragmentSnapshotCreateController extends PhragmentController {
->setPrimaryFragmentPHID($fragment->getPHID())
->setName($v_name)
->save();
} catch (AphrontQueryDuplicateKeyException $e) {
} catch (AphrontDuplicateKeyQueryException $e) {
$errors[] = pht('A snapshot with this name already exists.');
}

View file

@ -44,7 +44,7 @@ final class ReleephProductCreateController extends ReleephProductController {
return id(new AphrontRedirectResponse())
->setURI($releeph_product->getURI());
} catch (AphrontQueryDuplicateKeyException $ex) {
} catch (AphrontDuplicateKeyQueryException $ex) {
$e_name = pht('Not Unique');
$errors[] = pht('Another product already uses this name.');
}

View file

@ -134,7 +134,7 @@ final class RepositoryCreateConduitAPIMethod
try {
$repository->save();
} catch (AphrontQueryDuplicateKeyException $ex) {
} catch (AphrontDuplicateKeyQueryException $ex) {
throw new ConduitException('ERR-DUPLICATE');
}

View file

@ -632,7 +632,7 @@ final class PhabricatorRepositoryDiscoveryEngine
} catch (AphrontQueryDuplicateKeyException $ex) {
} catch (AphrontDuplicateKeyQueryException $ex) {
$commit->killTransaction();
// Ignore. This can happen because we discover the same new commit
// more than once when looking at history, or because of races or

View file

@ -59,7 +59,7 @@ final class PhabricatorSearchController
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
try {
$saved->setID(null)->save();
} catch (AphrontQueryDuplicateKeyException $ex) {
} catch (AphrontDuplicateKeyQueryException $ex) {
// Ignore, this is just a repeated search.
}
unset($unguarded);

View file

@ -52,7 +52,7 @@ abstract class PhabricatorApplicationSearchEngine {
$unguarded = AphrontWriteGuard::beginScopedUnguardedWrites();
try {
$query->save();
} catch (AphrontQueryDuplicateKeyException $ex) {
} catch (AphrontDuplicateKeyQueryException $ex) {
// Ignore, this is just a repeated search.
}
unset($unguarded);

View file

@ -210,7 +210,7 @@ final class PhabricatorSettingsPanelEmailAddresses
->addSubmitButton(pht('Done'));
return id(new AphrontDialogResponse())->setDialog($dialog);
} catch (AphrontQueryDuplicateKeyException $ex) {
} catch (AphrontDuplicateKeyQueryException $ex) {
$email = pht('Duplicate');
$errors[] = pht('Another user already has this email.');
}

View file

@ -103,7 +103,7 @@ final class PhabricatorSettingsPanelSSHKeys
$key->save();
return id(new AphrontRedirectResponse())
->setURI($this->getPanelURI());
} catch (AphrontQueryDuplicateKeyException $ex) {
} catch (AphrontDuplicateKeyQueryException $ex) {
$e_key = pht('Duplicate');
$errors[] = pht('This public key is already associated with a user '.
'account.');

View file

@ -134,7 +134,7 @@ final class AphrontIsolatedDatabaseConnectionTestCase
null,
$row,
'Expect fake row to exist only in isolation.');
} catch (AphrontQueryConnectionException $ex) {
} catch (AphrontConnectionQueryException $ex) {
// If we can't connect to the database, conclude that the isolated
// connection actually is isolated. Philosophically, this perhaps allows
// us to claim this test does not depend on the database?

View file

@ -28,7 +28,7 @@ final class AphrontMySQLDatabaseConnectionTestCase
$caught = null;
try {
queryfx($conn, 'SELECT 1');
} catch (AphrontQueryConnectionLostException $ex) {
} catch (AphrontConnectionLostQueryException $ex) {
$caught = $ex;
}
$this->assertTrue($caught instanceof Exception);

View file

@ -460,7 +460,7 @@ abstract class LiskDAO {
$args);
if (count($data) > 1) {
throw new AphrontQueryCountException(
throw new AphrontCountQueryException(
'More than 1 result from loadOneWhere()!');
}
@ -517,7 +517,7 @@ abstract class LiskDAO {
$this->getID());
if (!$result) {
throw new AphrontQueryObjectMissingException();
throw new AphrontObjectMissingQueryException();
}
return $this;
@ -771,7 +771,7 @@ abstract class LiskDAO {
}
if (count($relatives) > 1) {
throw new AphrontQueryCountException(
throw new AphrontCountQueryException(
'More than 1 result from loadOneRelative()!');
}
@ -1183,7 +1183,7 @@ abstract class LiskDAO {
} else {
$data[$key] = qsprintf($conn, '%ns', $value);
}
} catch (AphrontQueryParameterException $parameter_exception) {
} catch (AphrontParameterQueryException $parameter_exception) {
throw new PhutilProxyException(
pht(
"Unable to insert or update object of class %s, field '%s' ".