Provide better strings in policy errors and exceptions
Summary: Ref T603. This could probably use a little more polish, but improve the quality of policy error messages. - Provide as much detail as possible. - Fix all the strings for i18n. - Explain special rules to the user. - Allow indirect policy filters to raise policy exceptions instead of 404s. Test Plan: See screenshots. Reviewers: btrahan, chad Reviewed By: chad CC: aran Maniphest Tasks: T603 Differential Revision: https://secure.phabricator.com/D7151
This commit is contained in:
@@ -164,9 +164,23 @@ class AphrontDefaultApplicationConfiguration
|
||||
return $login_controller->processRequest();
|
||||
}
|
||||
|
||||
$content = hsprintf(
|
||||
'<div class="aphront-policy-exception">%s</div>',
|
||||
$ex->getMessage());
|
||||
$list = $ex->getMoreInfo();
|
||||
foreach ($list as $key => $item) {
|
||||
$list[$key] = phutil_tag('li', array(), $item);
|
||||
}
|
||||
if ($list) {
|
||||
$list = phutil_tag('ul', array(), $list);
|
||||
}
|
||||
|
||||
$content = phutil_tag(
|
||||
'div',
|
||||
array(
|
||||
'class' => 'aphront-policy-exception',
|
||||
),
|
||||
array(
|
||||
$ex->getMessage(),
|
||||
$list,
|
||||
));
|
||||
|
||||
$dialog = new AphrontDialogView();
|
||||
$dialog
|
||||
|
||||
Reference in New Issue
Block a user