Page MenuHomePhabricator

D12803.id30779.diff
No OneTemporary

D12803.id30779.diff

diff --git a/src/__phutil_library_map__.php b/src/__phutil_library_map__.php
--- a/src/__phutil_library_map__.php
+++ b/src/__phutil_library_map__.php
@@ -1954,6 +1954,8 @@
'PhabricatorInternationalizationManagementExtractWorkflow' => 'infrastructure/internationalization/management/PhabricatorInternationalizationManagementExtractWorkflow.php',
'PhabricatorInternationalizationManagementWorkflow' => 'infrastructure/internationalization/management/PhabricatorInternationalizationManagementWorkflow.php',
'PhabricatorInvalidConfigSetupCheck' => 'applications/config/check/PhabricatorInvalidConfigSetupCheck.php',
+ 'PhabricatorInvalidStateException' => 'infrastructure/exception/PhabricatorInvalidStateException.php',
+ 'PhabricatorInvalidStateExceptionTestCase' => 'infrastructure/exception/__tests__/PhabricatorInvalidStateExceptionTestCase.php',
'PhabricatorIteratedMD5PasswordHasher' => 'infrastructure/util/password/PhabricatorIteratedMD5PasswordHasher.php',
'PhabricatorJIRAAuthProvider' => 'applications/auth/provider/PhabricatorJIRAAuthProvider.php',
'PhabricatorJavelinLinter' => 'infrastructure/lint/linter/PhabricatorJavelinLinter.php',
@@ -5362,6 +5364,8 @@
'PhabricatorInternationalizationManagementExtractWorkflow' => 'PhabricatorInternationalizationManagementWorkflow',
'PhabricatorInternationalizationManagementWorkflow' => 'PhabricatorManagementWorkflow',
'PhabricatorInvalidConfigSetupCheck' => 'PhabricatorSetupCheck',
+ 'PhabricatorInvalidStateException' => 'Exception',
+ 'PhabricatorInvalidStateExceptionTestCase' => 'PhabricatorTestCase',
'PhabricatorIteratedMD5PasswordHasher' => 'PhabricatorPasswordHasher',
'PhabricatorJIRAAuthProvider' => 'PhabricatorOAuth1AuthProvider',
'PhabricatorJavelinLinter' => 'ArcanistLinter',
diff --git a/src/applications/auth/provider/PhabricatorAuthProvider.php b/src/applications/auth/provider/PhabricatorAuthProvider.php
--- a/src/applications/auth/provider/PhabricatorAuthProvider.php
+++ b/src/applications/auth/provider/PhabricatorAuthProvider.php
@@ -15,11 +15,7 @@
public function getProviderConfig() {
if ($this->providerConfig === null) {
- throw new Exception(
- pht(
- 'Call %s before %s!',
- 'attachProviderConfig()',
- __FUNCTION__.'()'));
+ throw new PhabricatorInvalidStateException('attachProviderConfig');
}
return $this->providerConfig;
}
diff --git a/src/applications/celerity/CelerityResourceGraph.php b/src/applications/celerity/CelerityResourceGraph.php
--- a/src/applications/celerity/CelerityResourceGraph.php
+++ b/src/applications/celerity/CelerityResourceGraph.php
@@ -7,10 +7,7 @@
protected function loadEdges(array $nodes) {
if (!$this->graphSet) {
- throw new Exception(
- pht(
- 'Call %s before loading the graph!',
- 'setResourceGraph()'));
+ throw new PhabricatorInvalidStateException('setResourceGraph');
}
$graph = $this->getResourceGraph();
diff --git a/src/applications/config/option/PhabricatorConfigOption.php b/src/applications/config/option/PhabricatorConfigOption.php
--- a/src/applications/config/option/PhabricatorConfigOption.php
+++ b/src/applications/config/option/PhabricatorConfigOption.php
@@ -124,10 +124,7 @@
return $this->enumOptions;
}
- throw new Exception(
- pht(
- 'Call %s before trying to access them!',
- 'setEnumOptions()'));
+ throw new PhabricatorInvalidStateException('setEnumOptions');
}
public function setKey($key) {
diff --git a/src/applications/config/schema/PhabricatorConfigSchemaQuery.php b/src/applications/config/schema/PhabricatorConfigSchemaQuery.php
--- a/src/applications/config/schema/PhabricatorConfigSchemaQuery.php
+++ b/src/applications/config/schema/PhabricatorConfigSchemaQuery.php
@@ -11,10 +11,7 @@
protected function getAPI() {
if (!$this->api) {
- throw new Exception(
- pht(
- 'Call %s before issuing a query!',
- 'setAPI()'));
+ throw new PhabricatorInvalidStateException('setAPI');
}
return $this->api;
}
diff --git a/src/applications/daemon/view/PhabricatorDaemonLogEventsView.php b/src/applications/daemon/view/PhabricatorDaemonLogEventsView.php
--- a/src/applications/daemon/view/PhabricatorDaemonLogEventsView.php
+++ b/src/applications/daemon/view/PhabricatorDaemonLogEventsView.php
@@ -27,10 +27,7 @@
$rows = array();
if (!$this->user) {
- throw new Exception(
- pht(
- 'Call %s before rendering!',
- 'setUser()'));
+ throw new PhabricatorInvalidStateException('setUser');
}
foreach ($this->events as $event) {
diff --git a/src/applications/daemon/view/PhabricatorDaemonLogListView.php b/src/applications/daemon/view/PhabricatorDaemonLogListView.php
--- a/src/applications/daemon/view/PhabricatorDaemonLogListView.php
+++ b/src/applications/daemon/view/PhabricatorDaemonLogListView.php
@@ -14,10 +14,7 @@
$rows = array();
if (!$this->user) {
- throw new Exception(
- pht(
- 'Call %s before rendering!',
- 'setUser()'));
+ throw new PhabricatorInvalidStateException('setUser');
}
$env_hash = PhabricatorEnv::calculateEnvironmentHash();
diff --git a/src/applications/differential/view/DifferentialLocalCommitsView.php b/src/applications/differential/view/DifferentialLocalCommitsView.php
--- a/src/applications/differential/view/DifferentialLocalCommitsView.php
+++ b/src/applications/differential/view/DifferentialLocalCommitsView.php
@@ -19,11 +19,7 @@
public function render() {
$user = $this->user;
if (!$user) {
- throw new Exception(
- pht(
- 'Call %s before %s-ing this view.',
- 'setUser()',
- __FUNCTION__.'()'));
+ throw new PhabricatorInvalidStateException('setUser');
}
$local = $this->localCommits;
diff --git a/src/applications/differential/view/DifferentialRevisionListView.php b/src/applications/differential/view/DifferentialRevisionListView.php
--- a/src/applications/differential/view/DifferentialRevisionListView.php
+++ b/src/applications/differential/view/DifferentialRevisionListView.php
@@ -59,11 +59,7 @@
public function render() {
$user = $this->user;
if (!$user) {
- throw new Exception(
- pht(
- 'Call %s before %s!',
- 'setUser()',
- __FUNCTION__.'()'));
+ throw new PhabricatorInvalidStateException('setUser');
}
$fresh = PhabricatorEnv::getEnvConfig('differential.days-fresh');
diff --git a/src/applications/diffusion/query/DiffusionLintCountQuery.php b/src/applications/diffusion/query/DiffusionLintCountQuery.php
--- a/src/applications/diffusion/query/DiffusionLintCountQuery.php
+++ b/src/applications/diffusion/query/DiffusionLintCountQuery.php
@@ -23,19 +23,11 @@
public function execute() {
if (!$this->paths) {
- throw new Exception(
- pht(
- 'Call %s before %s!',
- 'withPaths()',
- __FUNCTION__.'()'));
+ throw new PhabricatorInvalidStateException('withPaths');
}
if (!$this->branchIDs) {
- throw new Exception(
- pht(
- 'Call %s before %s!',
- 'withBranchIDs()',
- __FUNCTION__.'()'));
+ throw new PhabricatorInvalidStateException('withBranchIDs');
}
$conn_r = id(new PhabricatorRepositoryCommit())->establishConnection('r');
diff --git a/src/applications/diffusion/query/lowlevel/DiffusionLowLevelQuery.php b/src/applications/diffusion/query/lowlevel/DiffusionLowLevelQuery.php
--- a/src/applications/diffusion/query/lowlevel/DiffusionLowLevelQuery.php
+++ b/src/applications/diffusion/query/lowlevel/DiffusionLowLevelQuery.php
@@ -17,11 +17,7 @@
public function execute() {
if (!$this->getRepository()) {
- throw new Exception(
- pht(
- 'Call %s before %s!',
- 'setRepository()',
- __FUNCTION__.'()'));
+ throw new PhabricatorInvalidStateException('setRepository');
}
return $this->executeQuery();
diff --git a/src/applications/diviner/atom/DivinerAtom.php b/src/applications/diviner/atom/DivinerAtom.php
--- a/src/applications/diviner/atom/DivinerAtom.php
+++ b/src/applications/diviner/atom/DivinerAtom.php
@@ -95,22 +95,14 @@
public function getDocblockText() {
if ($this->docblockText === null) {
- throw new Exception(
- pht(
- 'Call %s before %s!',
- 'setDocblockRaw()',
- __FUNCTION__.'()'));
+ throw new PhabricatorInvalidStateException('setDocblockRaw');
}
return $this->docblockText;
}
public function getDocblockMeta() {
if ($this->docblockMeta === null) {
- throw new Exception(
- pht(
- 'Call %s before %s!',
- 'setDocblockRaw()',
- __FUNCTION__.'()'));
+ throw new PhabricatorInvalidStateException('setDocblockRaw');
}
return $this->docblockMeta;
}
diff --git a/src/applications/doorkeeper/view/DoorkeeperTagView.php b/src/applications/doorkeeper/view/DoorkeeperTagView.php
--- a/src/applications/doorkeeper/view/DoorkeeperTagView.php
+++ b/src/applications/doorkeeper/view/DoorkeeperTagView.php
@@ -12,11 +12,7 @@
public function render() {
$xobj = $this->xobj;
if (!$xobj) {
- throw new Exception(
- pht(
- 'Call %s before %s!',
- 'setExternalObject()',
- __FUNCTION__.'()'));
+ throw new PhabricatorInvalidStateException('setExternalObject');
}
$tag_id = celerity_generate_unique_node_id();
diff --git a/src/applications/files/controller/PhabricatorFileDataController.php b/src/applications/files/controller/PhabricatorFileDataController.php
--- a/src/applications/files/controller/PhabricatorFileDataController.php
+++ b/src/applications/files/controller/PhabricatorFileDataController.php
@@ -227,11 +227,7 @@
private function getFile() {
if (!$this->file) {
- throw new Exception(
- pht(
- 'Call %s before %s!',
- 'loadFile()',
- __FUNCTION__.'()'));
+ throw new PhabricatorInvalidStateException('loadFile');
}
return $this->file;
}
diff --git a/src/applications/fund/phortune/FundBackerCart.php b/src/applications/fund/phortune/FundBackerCart.php
--- a/src/applications/fund/phortune/FundBackerCart.php
+++ b/src/applications/fund/phortune/FundBackerCart.php
@@ -33,10 +33,7 @@
$initiative = $this->getInitiative();
if (!$initiative) {
- throw new Exception(
- pht(
- 'Call %s before building a cart!',
- 'setInitiative()'));
+ throw new PhabricatorInvalidStateException('setInitiative');
}
$cart->setMetadataValue('initiativePHID', $initiative->getPHID());
diff --git a/src/applications/multimeter/data/MultimeterControl.php b/src/applications/multimeter/data/MultimeterControl.php
--- a/src/applications/multimeter/data/MultimeterControl.php
+++ b/src/applications/multimeter/data/MultimeterControl.php
@@ -88,10 +88,7 @@
}
if ($this->sampleRate === null) {
- throw new Exception(
- pht(
- 'Call %s before saving events!',
- 'setSampleRate()'));
+ throw new PhabricatorInvalidStateException('setSampleRate');
}
$this->addServiceEvents();
diff --git a/src/applications/paste/view/PasteEmbedView.php b/src/applications/paste/view/PasteEmbedView.php
--- a/src/applications/paste/view/PasteEmbedView.php
+++ b/src/applications/paste/view/PasteEmbedView.php
@@ -28,11 +28,7 @@
public function render() {
if (!$this->paste) {
- throw new Exception(
- pht(
- 'Call %s before %s!',
- 'setPaste()',
- __FUNCTION__.'()'));
+ throw new PhabricatorInvalidStateException('setPaste');
}
$lines = phutil_split_lines($this->paste->getContent());
diff --git a/src/applications/phid/query/PhabricatorObjectQuery.php b/src/applications/phid/query/PhabricatorObjectQuery.php
--- a/src/applications/phid/query/PhabricatorObjectQuery.php
+++ b/src/applications/phid/query/PhabricatorObjectQuery.php
@@ -78,11 +78,7 @@
public function getNamedResults() {
if ($this->namedResults === null) {
- throw new Exception(
- pht(
- 'Call %s before %s!',
- 'execute()',
- __FUNCTION__.'()'));
+ throw new PhabricatorInvalidStateException('execute');
}
return $this->namedResults;
}
diff --git a/src/applications/pholio/view/PholioMockEmbedView.php b/src/applications/pholio/view/PholioMockEmbedView.php
--- a/src/applications/pholio/view/PholioMockEmbedView.php
+++ b/src/applications/pholio/view/PholioMockEmbedView.php
@@ -17,11 +17,7 @@
public function render() {
if (!$this->mock) {
- throw new Exception(
- pht(
- 'Call %s before %s!',
- 'setMock()',
- __FUNCTION__.'()'));
+ throw new PhabricatorInvalidStateException('setMock');
}
$mock = $this->mock;
diff --git a/src/applications/phortune/cart/PhortuneSubscriptionCart.php b/src/applications/phortune/cart/PhortuneSubscriptionCart.php
--- a/src/applications/phortune/cart/PhortuneSubscriptionCart.php
+++ b/src/applications/phortune/cart/PhortuneSubscriptionCart.php
@@ -34,10 +34,7 @@
$subscription = $this->getSubscription();
if (!$subscription) {
- throw new Exception(
- pht(
- 'Call %s before building a cart!',
- 'setSubscription()'));
+ throw new PhabricatorInvalidStateException('setSubscription');
}
$cart->setMetadataValue('subscriptionPHID', $subscription->getPHID());
diff --git a/src/applications/search/controller/PhabricatorApplicationSearchController.php b/src/applications/search/controller/PhabricatorApplicationSearchController.php
--- a/src/applications/search/controller/PhabricatorApplicationSearchController.php
+++ b/src/applications/search/controller/PhabricatorApplicationSearchController.php
@@ -55,18 +55,12 @@
$engine = $this->getSearchEngine();
if (!$engine) {
- throw new Exception(
- pht(
- 'Call %s before delegating to this controller!',
- 'setEngine()'));
+ throw new PhabricatorInvalidStateException('setEngine');
}
$nav = $this->getNavigation();
if (!$nav) {
- throw new Exception(
- pht(
- 'Call %s before delegating to this controller!',
- 'setNavigation()'));
+ throw new PhabricatorInvalidStateException('setNavigation');
}
$engine->setViewer($this->getRequest()->getUser());
diff --git a/src/applications/search/engine/PhabricatorApplicationSearchEngine.php b/src/applications/search/engine/PhabricatorApplicationSearchEngine.php
--- a/src/applications/search/engine/PhabricatorApplicationSearchEngine.php
+++ b/src/applications/search/engine/PhabricatorApplicationSearchEngine.php
@@ -33,10 +33,7 @@
protected function requireViewer() {
if (!$this->viewer) {
- throw new Exception(
- pht(
- 'Call %s before using an engine!',
- 'setViewer()'));
+ throw new PhabricatorInvalidStateException('setViewer');
}
return $this->viewer;
}
diff --git a/src/applications/slowvote/view/SlowvoteEmbedView.php b/src/applications/slowvote/view/SlowvoteEmbedView.php
--- a/src/applications/slowvote/view/SlowvoteEmbedView.php
+++ b/src/applications/slowvote/view/SlowvoteEmbedView.php
@@ -22,11 +22,7 @@
public function render() {
if (!$this->poll) {
- throw new Exception(
- pht(
- 'Call %s before %s)!',
- 'setPoll()',
- __FUNCTION__.'()'));
+ throw new PhabricatorInvalidStateException('setPoll');
}
$poll = $this->poll;
diff --git a/src/applications/subscriptions/editor/PhabricatorSubscriptionsEditor.php b/src/applications/subscriptions/editor/PhabricatorSubscriptionsEditor.php
--- a/src/applications/subscriptions/editor/PhabricatorSubscriptionsEditor.php
+++ b/src/applications/subscriptions/editor/PhabricatorSubscriptionsEditor.php
@@ -56,11 +56,7 @@
public function save() {
if (!$this->object) {
- throw new Exception(
- pht(
- 'Call %s before %s!',
- 'setObject()',
- __FUNCTION__.'()'));
+ throw new PhabricatorInvalidStateException('setObject');
}
$actor = $this->requireActor();
diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionCommentEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionCommentEditor.php
--- a/src/applications/transactions/editor/PhabricatorApplicationTransactionCommentEditor.php
+++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionCommentEditor.php
@@ -135,11 +135,7 @@
}
if (!$this->getContentSource()) {
- throw new Exception(
- pht(
- 'Call %s before %s!',
- 'setContentSource()',
- 'applyEdit()'));
+ throw new PhabricatorInvalidStateException('applyEdit');
}
$actor = $this->requireActor();
diff --git a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
--- a/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
+++ b/src/applications/transactions/editor/PhabricatorApplicationTransactionEditor.php
@@ -973,11 +973,7 @@
array $xactions) {
if (!$this->getContentSource()) {
- throw new Exception(
- pht(
- 'Call %s before %s!',
- 'setContentSource()',
- 'applyTransactions()'));
+ throw new PhabricatorInvalidStateException('setContentSource');
}
// Do a bunch of sanity checks that the incoming transactions are fresh.
diff --git a/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php b/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php
--- a/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php
+++ b/src/applications/transactions/view/PhabricatorApplicationTransactionCommentView.php
@@ -149,11 +149,7 @@
}
if (!$this->getObjectPHID()) {
- throw new Exception(
- pht(
- 'Call %s before %s!',
- 'setObjectPHID()',
- 'render()'));
+ throw new PhabricatorInvalidStateException('setObjectPHID', 'render');
}
return id(new AphrontFormView())
diff --git a/src/infrastructure/diff/view/PHUIDiffInlineCommentEditView.php b/src/infrastructure/diff/view/PHUIDiffInlineCommentEditView.php
--- a/src/infrastructure/diff/view/PHUIDiffInlineCommentEditView.php
+++ b/src/infrastructure/diff/view/PHUIDiffInlineCommentEditView.php
@@ -76,18 +76,10 @@
public function render() {
if (!$this->uri) {
- throw new Exception(
- pht(
- 'Call %s before %s!',
- 'setSubmitURI()',
- __FUNCTION__.'()'));
+ throw new PhabricatorInvalidStateException('setSubmitURI');
}
if (!$this->user) {
- throw new Exception(
- pht(
- 'Call %s before %s!',
- 'setUser()',
- __FUNCTION__.'()'));
+ throw new PhabricatorInvalidStateException('setUser');
}
$content = phabricator_form(
diff --git a/src/infrastructure/exception/PhabricatorInvalidStateException.php b/src/infrastructure/exception/PhabricatorInvalidStateException.php
new file mode 100644
--- /dev/null
+++ b/src/infrastructure/exception/PhabricatorInvalidStateException.php
@@ -0,0 +1,30 @@
+<?php
+
+final class PhabricatorInvalidStateException extends Exception {
+ private $callee;
+ private $function;
+
+ public function __construct($function, $callee = null) {
+ if ($callee === null) {
+ $callee = idx(debug_backtrace(), 1);
+ $callee = idx($callee, 'function');
+ }
+
+ $this->callee = $callee;
+ $this->function = $function;
+
+ parent::__construct(
+ pht(
+ 'Call %s before calling %s!',
+ $this->function.'()',
+ $this->callee.'()'));
+ }
+
+ public function getCallee() {
+ return $this->callee;
+ }
+
+ public function getFunction() {
+ return $this->function;
+ }
+}
diff --git a/src/infrastructure/exception/__tests__/PhabricatorInvalidStateExceptionTestCase.php b/src/infrastructure/exception/__tests__/PhabricatorInvalidStateExceptionTestCase.php
new file mode 100644
--- /dev/null
+++ b/src/infrastructure/exception/__tests__/PhabricatorInvalidStateExceptionTestCase.php
@@ -0,0 +1,18 @@
+<?php
+
+final class PhabricatorInvalidStateExceptionTestCase
+ extends PhabricatorTestCase {
+
+ public function testException() {
+ try {
+ throw new PhabricatorInvalidStateException('someMethod');
+ } catch (PhabricatorInvalidStateException $ex) {
+ $this->assertEqual(
+ __FUNCTION__,
+ $ex->getCallee());
+ $this->assertEqual(
+ 'someMethod',
+ $ex->getFunction());
+ }
+ }
+}
diff --git a/src/view/control/AphrontCursorPagerView.php b/src/view/control/AphrontCursorPagerView.php
--- a/src/view/control/AphrontCursorPagerView.php
+++ b/src/view/control/AphrontCursorPagerView.php
@@ -92,11 +92,7 @@
public function getFirstPageURI() {
if (!$this->uri) {
- throw new Exception(
- pht(
- 'You must call %s before you can call %s.',
- 'setURI()',
- __FUNCTION__.'()'));
+ throw new PhabricatorInvalidStateException('setURI');
}
if (!$this->afterID && !($this->beforeID && $this->moreResults)) {
@@ -110,11 +106,7 @@
public function getPrevPageURI() {
if (!$this->uri) {
- throw new Exception(
- pht(
- 'You must call %s before you can call %s.',
- 'getPrevPageURI()',
- __FUNCTION__.'()'));
+ throw new PhabricatorInvalidStateException('getPrevPageURI');
}
if (!$this->prevPageID) {
@@ -128,11 +120,7 @@
public function getNextPageURI() {
if (!$this->uri) {
- throw new Exception(
- pht(
- 'You must call %s before you can call %s.',
- 'setURI()',
- __FUNCTION__.'()'));
+ throw new PhabricatorInvalidStateException('setURI');
}
if (!$this->nextPageID) {
@@ -146,11 +134,7 @@
public function render() {
if (!$this->uri) {
- throw new Exception(
- pht(
- 'You must call %s before you can call %s.',
- 'setURI()',
- __FUNCTION__.'()'));
+ throw new PhabricatorInvalidStateException('setURI');
}
$links = array();
diff --git a/src/view/control/AphrontPagerView.php b/src/view/control/AphrontPagerView.php
--- a/src/view/control/AphrontPagerView.php
+++ b/src/view/control/AphrontPagerView.php
@@ -109,11 +109,7 @@
public function render() {
if (!$this->uri) {
- throw new Exception(
- pht(
- 'You must call %s before you can call %s.',
- 'setURI()',
- __FUNCTION__.'()'));
+ throw new PhabricatorInvalidStateException('setURI');
}
require_celerity_resource('aphront-pager-view-css');
diff --git a/src/view/phui/PHUIRemarkupPreviewPanel.php b/src/view/phui/PHUIRemarkupPreviewPanel.php
--- a/src/view/phui/PHUIRemarkupPreviewPanel.php
+++ b/src/view/phui/PHUIRemarkupPreviewPanel.php
@@ -72,16 +72,10 @@
protected function getTagContent() {
if ($this->previewURI === null) {
- throw new Exception(
- pht(
- 'Call %s before rendering!',
- 'setPreviewURI()'));
+ throw new PhabricatorInvalidStateException('setPreviewURI');
}
if ($this->controlID === null) {
- throw new Exception(
- pht(
- 'Call %s before rendering!',
- 'setControlID()'));
+ throw new PhabricatorInvalidStateException('setControlID');
}
$preview_id = celerity_generate_unique_node_id();
diff --git a/src/view/phui/calendar/PHUICalendarMonthView.php b/src/view/phui/calendar/PHUICalendarMonthView.php
--- a/src/view/phui/calendar/PHUICalendarMonthView.php
+++ b/src/view/phui/calendar/PHUICalendarMonthView.php
@@ -48,11 +48,7 @@
public function render() {
if (empty($this->user)) {
- throw new Exception(
- pht(
- 'Call %s before %s!',
- 'setUser()',
- __FUNCTION__.'()'));
+ throw new PhabricatorInvalidStateException('setUser');
}
$events = msort($this->events, 'getEpochStart');
diff --git a/src/view/widget/hovercard/PhabricatorHovercardView.php b/src/view/widget/hovercard/PhabricatorHovercardView.php
--- a/src/view/widget/hovercard/PhabricatorHovercardView.php
+++ b/src/view/widget/hovercard/PhabricatorHovercardView.php
@@ -62,11 +62,7 @@
public function render() {
if (!$this->handle) {
- throw new Exception(
- pht(
- 'Call %s before calling %s!',
- 'setObjectHandle()',
- __FUNCTION__.'()'));
+ throw new PhabricatorInvalidStateException('setObjectHandle');
}
$handle = $this->handle;

File Metadata

Mime Type
text/plain
Expires
Mar 22 2025, 2:59 PM (4 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7687838
Default Alt Text
D12803.id30779.diff (24 KB)

Event Timeline