1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 09:18:48 +02:00

Throw a more tailored error when a storage upgrade patch can't access a database

Summary: Fixes T8762.

Test Plan: Ran `bin/storage upgrade --namespace ... --user limited`, saw a more specific error.

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T8762

Differential Revision: https://secure.phabricator.com/D15080
This commit is contained in:
epriestley 2016-01-21 13:15:38 -08:00
parent 6a701c1988
commit 5f170847ca

View file

@ -256,10 +256,19 @@ final class PhabricatorStorageManagementAPI extends Phobject {
$query = str_replace('{$'.$key.'}', $value, $query);
}
queryfx(
$conn,
'%Q',
$query);
try {
queryfx($conn, '%Q', $query);
} catch (AphrontAccessDeniedQueryException $ex) {
throw new PhutilProxyException(
pht(
'Unable to access a required database or table. This almost '.
'always means that the user you are connecting with ("%s") does '.
'not have sufficient permissions granted in MySQL. You can '.
'use `bin/storage databases` to get a list of all databases '.
'permission is required on.',
$this->getUser()),
$ex);
}
}
}