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:
parent
21dca29c5f
commit
8fd098329b
29 changed files with 35 additions and 35 deletions
|
@ -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";
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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.
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -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 ".
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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".
|
||||
|
|
|
@ -16,7 +16,7 @@ final class DifferentialDraft extends DifferentialDAO {
|
|||
->setAuthorPHID($author_phid)
|
||||
->setDraftKey($draft_key)
|
||||
->save();
|
||||
} catch (AphrontQueryDuplicateKeyException $ex) {
|
||||
} catch (AphrontDuplicateKeyQueryException $ex) {
|
||||
// no worries
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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.');
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
|
|
|
@ -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.');
|
||||
}
|
||||
|
|
|
@ -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.');
|
||||
}
|
||||
|
|
|
@ -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())
|
||||
|
|
|
@ -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.');
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ final class PhabricatorPeopleTestDataGenerator
|
|||
->createNewUser($user, $email_object);
|
||||
|
||||
return $user;
|
||||
} catch (AphrontQueryDuplicateKeyException $ex) {
|
||||
} catch (AphrontDuplicateKeyQueryException $ex) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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');
|
||||
}
|
||||
|
|
|
@ -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.');
|
||||
|
|
|
@ -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.');
|
||||
}
|
||||
|
|
|
@ -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.');
|
||||
}
|
||||
|
||||
|
|
|
@ -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.');
|
||||
}
|
||||
|
|
|
@ -134,7 +134,7 @@ final class RepositoryCreateConduitAPIMethod
|
|||
|
||||
try {
|
||||
$repository->save();
|
||||
} catch (AphrontQueryDuplicateKeyException $ex) {
|
||||
} catch (AphrontDuplicateKeyQueryException $ex) {
|
||||
throw new ConduitException('ERR-DUPLICATE');
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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.');
|
||||
}
|
||||
|
|
|
@ -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.');
|
||||
|
|
|
@ -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?
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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' ".
|
||||
|
|
Loading…
Reference in a new issue