Select the types of activity you want to include in your feed.
@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.)
hq.recaptime.dev/wiki/Phorge
···35353636 throw new PhutilMethodNotImplementedException(
3737 pht(
3838- 'Controllers must implement either handleRequest() (recommended) '.
3939- 'or processRequest() (deprecated).'));
3838+ 'Controllers must implement either %s (recommended) '.
3939+ 'or %s (deprecated).',
4040+ 'handleRequest()',
4141+ 'processRequest()'));
4042 }
41434244 final public function setRequest(AphrontRequest $request) {
···46484749 final public function getRequest() {
4850 if (!$this->request) {
4949- throw new Exception(pht('Call setRequest() before getRequest()!'));
5151+ throw new PhutilInvalidStateException('setRequest');
5052 }
5153 return $this->request;
5254 }
···8183 }
82848385 public function getDefaultResourceSource() {
8484- throw new Exception(
8686+ throw new PhutilMethodNotImplementedException(
8587 pht(
8686- 'A Controller must implement getDefaultResourceSource() before you '.
8787- 'can invoke requireResource() or initBehavior().'));
8888+ 'A Controller must implement %s before you can invoke %s or %s.',
8989+ 'getDefaultResourceSource()',
9090+ 'requireResource()',
9191+ 'initBehavior()'));
8892 }
89939094 public function requireResource($symbol) {
···18181919 public function getViewer() {
2020 if (!$this->viewer) {
2121- throw new Exception(pht('Call setViewer() before getViewer()!'));
2121+ throw new PhutilInvalidStateException('setViewer');
2222 }
2323 return $this->viewer;
2424 }
···6464 public function render() {
6565 $viewer = $this->getUser();
6666 if (!$viewer) {
6767- throw new Exception(pht('Call setUser() before render()!'));
6767+ throw new PhutilInvalidStateException('setUser');
6868 }
69697070 require_celerity_resource('conpherence-transaction-css');
+7
src/applications/console/core/DarkConsoleCore.php
···127127 }
128128 return $data;
129129 } else {
130130+ // Truncate huge strings. Since the data doesn't really matter much,
131131+ // just truncate bytes to avoid PhutilUTF8StringTruncator overhead.
132132+ $length = strlen($data);
133133+ $max = 4096;
134134+ if ($length > $max) {
135135+ $data = substr($data, 0, $max).'...<'.$length.' bytes>...';
136136+ }
130137 return phutil_utf8ize($data);
131138 }
132139 }
···162162163163 protected function renderInput() {
164164 if (!$this->object) {
165165- throw new Exception(pht('Call setPolicyObject() before rendering!'));
165165+ throw new PhutilInvalidStateException('setPolicyObject');
166166 }
167167 if (!$this->capability) {
168168- throw new Exception(pht('Call setCapability() before rendering!'));
168168+ throw new PhutilInvalidStateException('setCapability');
169169 }
170170171171 $policy = $this->object->getPolicy($this->capability);
···109109 if (!$viewer) {
110110 throw new Exception(
111111 pht(
112112- 'Call setUser() before rendering tokenizers. Use appendControl() '.
113113- 'on AphrontFormView to do this easily.'));
112112+ 'Call %s before rendering tokenizers. '.
113113+ 'Use %s on %s to do this easily.',
114114+ 'setUser()',
115115+ 'appendControl()',
116116+ 'AphrontFormView'));
114117 }
115118116119 $values = nonempty($this->getValue(), array());
+2-2
src/view/layout/AphrontSideNavFilterView.php
···187187 public function render() {
188188 if ($this->menu->getItems()) {
189189 if (!$this->baseURI) {
190190- throw new Exception(pht('Call setBaseURI() before render()!'));
190190+ throw new PhutilInvalidStateException('setBaseURI');
191191 }
192192 if ($this->selectedFilter === false) {
193193- throw new Exception(pht('Call selectFilter() before render()!'));
193193+ throw new PhutilInvalidStateException('selectFilter');
194194 }
195195 }
196196
+1-1
src/view/layout/PhabricatorActionListView.php
···29293030 public function render() {
3131 if (!$this->user) {
3232- throw new Exception(pht('Call setUser() before render()!'));
3232+ throw new PhutilInvalidStateException('setUser');
3333 }
34343535 $event = new PhabricatorEvent(
+1-1
src/view/phui/PHUITagView.php
···144144145145 protected function getTagContent() {
146146 if (!$this->type) {
147147- throw new Exception(pht('You must call setType() before render()!'));
147147+ throw new PhutilInvalidStateException('setType', 'render');
148148 }
149149150150 $color = null;