Commit graph

19 commits

Author SHA1 Message Date
TChin
e67f822bc9 Revert "Introduce AbstractLocalizedException"
This reverts commit 0d453d915a.

Reason for revert: Trying to find a better approach than an abstract class

Change-Id: I69c0ec25cb920f41cb0eb6b3ad921d7b02290581
2021-09-14 19:01:21 +00:00
TChin
0d453d915a Introduce AbstractLocalizedException
AbstractLocalizedException acts like a shim to ILocalizedException in preperation for refactoring

Bug: T287405
Change-Id: I01e40e82457d49487829d9a435b7a1198369ecf6
2021-09-10 10:32:57 -04:00
jenkins-bot
39705eb311 Merge "Replace "@stable for subclassing" with "@stable to extend"" 2020-07-13 09:31:38 +00:00
jenkins-bot
0270990f0b Merge "Replace "@stable for calling" by "@stable to call"" 2020-07-13 09:27:04 +00:00
daniel
3c50afa46b Replace "@stable for subclassing" with "@stable to extend"
For compliance with the new version of the table interface policy
(T255803).

This patch was created by an automated search & replace operation
on the includes/ directory.

Bug: T257789
Change-Id: Ie32c1b11b3d16ddfc0c83a757327d449ff80b2e4
2020-07-13 11:00:30 +02:00
daniel
f7116bb3a2 Replace "@stable for overriding" with "@stable to override"
For compliance with the new version of the table interface policy
(T255803).

This patch was created by an automated search & replace operation
on the includes/ directory.

Bug: T257789
Change-Id: I5ffbb91882ecce2019ab644839eab5e8fb8a1c5f
2020-07-13 10:57:12 +02:00
daniel
272db6afde Replace "@stable for calling" by "@stable to call"
For compliance with the new version of the table interface policy
(T255803).

This patch was created by an automated search & replace operation
on the includes/ directory.

Bug: T257789
Change-Id: If560596f5e1e0a3da91afc36e656e7c27f040968
2020-07-13 08:55:28 +00:00
daniel
474181114d Mark exceptions as newable and stable for subclassing
This marks most remaining exceptions as newable, and some as stable for
subclassing.

Bug: T247862
Change-Id: Idf7c03346a83d4f22c24fb173142c18be0e11d77
2020-07-10 14:11:14 +02:00
daniel
bd5c3d06a2 Annotate newable classes
This annotates classes that can safely be instantiated by
extensions, per the Stable Interface Policy.

Bug: T247862
Change-Id: Ia280f559874fc0750265ddeb7f831e65fd7d7d6a
2020-07-07 15:38:57 +02:00
Reedy
d53e91d272 Fix more PSR12.Properties.ConstantVisibility.NotFound
Change-Id: I94520b10d78a17ea8e965633dd475ea711f25c99
2020-05-15 00:33:32 +01:00
Timo Tijhof
11e3172c03 exception: Let MediaWiki.php control final output for ErrorPageError
The same way it does already for non-error output. This makes
it so that doPreOutputCommit() consistently happens between
the staging of output and the actual sending of output.

It is still allowed for code to bypass this, such as for fatal
errors and for handlers that disable OutputPage (like Special:Export).

But for cases where we do want to perform doPreOutputCommit(), it
should be run consistently between staging and sending so that it
can make appropiate decisions based on the current state of
OutputPage.

Previously, the state of OutputPage seen by doPreOutputCommit()
would be the broken/incomplete output of a seemingly succesful
(possibly cacheable) user action, which would then, after
doPreOutputCommit() runs, be completely replaced by $e->report()/
$out->showErrorPage().

This is a prerequisite for being able to reliably send cookie-block
cookies on error pages (next patch).

Bug: T233594
Change-Id: Iaeaf5e55a5868e6be534ddda73f3b56b9d6ef8f0
2019-09-26 07:56:14 +00:00
Chad Horohoe
25c3c061b5 Fix/hack ErrorPageError to work from non-UI contexts
Right now, ErrorPageError *assumes* you're never running on the cli
or the API. It's kinda a crappy superclass to use for errors unless
you're 1000% sure you'll never hit that code path. Yay assumptions!

Ideally, all of this report() crap is cleaned up and unified across
the like 1192902117 places we have it spread out, but for now just
detect the scenario and delegate back to MWException, which does the
right thing

Bug: T168337
Change-Id: Ia2f490528e128527a7a5ef1f4f5eea36ec9ee810
2017-07-06 20:04:31 +00:00
James D. Forrester
9635dda73a includes: Replace implicit Bugzilla bug numbers with Phab ones
It's unreasonable to expect newbies to know that "bug 12345" means "Task T14345"
except where it doesn't, so let's just standardise on the real numbers.

Change-Id: I6f59febaf8fc96e80f8cfc11f4356283f461142a
2017-02-21 18:13:24 +00:00
Brad Jorsch
a90bbf1a48 Add ILocalizedException interface
We already throw around some exceptions that are localized
(ErrorPageError and its subclasses, MalformedTitleException), but
there's no standard way to recognize them. Let's change that.

Then let's use them in the API to be able to have internationalized
errors when such exceptions are caught, instead of wrapping the
English-language version.

Change-Id: Iac7c90f92a889f8de9dae373547c07b884addaea
2016-12-08 13:53:24 -05:00
Kunal Mehta
6e9b4f0e9c Convert all array() syntax to []
Per wikitech-l consensus:
 https://lists.wikimedia.org/pipermail/wikitech-l/2016-February/084821.html

Notes:
* Disabled CallTimePassByReference due to false positives (T127163)

Change-Id: I2c8ce713ce6600a0bb7bf67537c87044c7a45c4b
2016-02-17 01:33:00 -08:00
umherirrender
cf1d31b604 clone is not a function
Remove parenthesis around clone magic word

Change-Id: I2e0e53303f7c73745bd1ab4bcf32e74943efc4de
2015-10-16 19:34:31 +02:00
umherirrender
b883e8c7c0 Cleanup some docs (includes/[e-l])
- Swap "$variable type" to "type $variable"
- Added missing types
- Fixed spacing inside docs
- Makes beginning of @param/@return/@var/@throws in capital
- Changed some types to match the more common spelling

Change-Id: I41a84e8e1dec39170aa655250325ffc485eaeaef
2014-07-24 19:43:03 +02:00
addshore
7a56bf8168 Add scope to Exception class methods
Change-Id: I0097aa9a6d9c178c85706b90484f7a68d3ddbc8b
2014-02-24 21:21:09 +01:00
addshore
557af13086 Split Exception.php
Change-Id: I8273b342f8814887b65227457d0a461d7cd31e75
2014-02-24 21:17:59 +01:00