We raise policy exceptions from `didRejectResult()`, even with an omnipotent viewer, in some cases where the failure is caused by an object which does not exist. Here's an example trace:
[2013-11-15 16:11:08] EXCEPTION: (PhutilProxyException) Error while executing task ID 401100 from queue. {>} (PhabricatorPolicyException) [You Shall Not Pass: Differential Revision Unknown Object (Differential Revision)] (Can View) You do not have permission to view this object. // Logged in users can take this action. The owner of a revision can always view and edit it. A revision's reviewers can always view it. If a revision belongs to a repository, other users must be able to view the repository in order to view the revision. at [/opt/phabricator/phabricator/src/applications/policy/filter/PhabricatorPolicyFilter.php:317]
#0 PhabricatorPolicyFilter::rejectObject(Object DifferentialRevision, users, view) called at [/opt/phabricator/phabricator/src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php:322]
#1 PhabricatorPolicyAwareQuery::didRejectResult(Object DifferentialRevision) called at [/opt/phabricator/phabricator/src/applications/differential/query/DifferentialRevisionQuery.php:435]
#2 DifferentialRevisionQuery::willFilterPage(Array { 13 => Object DifferentialRevision }) called at [/opt/phabricator/phabricator/src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php:228]
#3 PhabricatorPolicyAwareQuery::execute() called at [/opt/phabricator/phabricator/src/infrastructure/query/policy/PhabricatorPolicyAwareQuery.php:159]
#4 PhabricatorPolicyAwareQuery::executeOne() called at [/opt/phabricator/phabricator/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryCommitMessageParserWorker.php:126]
#5 PhabricatorRepositoryCommitMessageParserWorker::updateCommitData(SOME PERSON <PERSON@SITE.COM>, Rough in internal profile screen, currently accessible from avatar in status bar
Summary:
Add rough-in of internal profile screen
Todos: Button actions, filling out data and toggling visibility of buttons, resolve scrollview/listview conflict for wall
Test Plan: Tap avatar in status bar, should show the user's profile screen
Reviewers: PERSON
Differential Revision: https://URLGOESHERE/D13
, null) called at [/opt/phabricator/phabricator/src/applications/repository/worker/commitmessageparser/PhabricatorRepositoryGitCommitMessageParserWorker.php:53]
#6 PhabricatorRepositoryGitCommitMessageParserWorker::parseCommit(Object PhabricatorRepository, Object PhabricatorRepositoryCommit) called at [/opt/phabricator/phabricator/src/applications/repository/worker/PhabricatorRepositoryCommitParserWorker.php:44]
#7 PhabricatorRepositoryCommitParserWorker::doWork() called at [/opt/phabricator/phabricator/src/infrastructure/daemon/workers/PhabricatorWorker.php:84]
#8 PhabricatorWorker::executeTask() called at [/opt/phabricator/phabricator/src/infrastructure/daemon/workers/storage/PhabricatorWorkerActiveTask.php:122]
#9 PhabricatorWorkerActiveTask::executeTask() called at [/opt/phabricator/phabricator/src/infrastructure/daemon/workers/PhabricatorTaskmasterDaemon.php:19]
#10 PhabricatorTaskmasterDaemon::run() called at [/opt/phabricator/libphutil/src/daemon/PhutilDaemon.php:81]
#11 PhutilDaemon::execute() called at [/opt/phabricator/libphutil/scripts/daemon/exec/exec_daemon.php:112]
These queries should fail to load, but not raise policy exceptions.