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:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user