wiki.techinc.nl/includes/exception
Timo Tijhof f2543d442a debug: Use native E_USER_DEPRECATED instead of custom channel
* Always use trigger_error for deprecation warnings, not just in development.
  They are still silent from the run-time perspective (not thrown as
  exceptions).

  Previously this code path was only called when $wgDevelopmentWarnings
  is set to true. For most dev environments and for CI, this means
  nothing much changes given that DevelopmentSettings.php set this to true.

* In the code path that handles native PHP warnings, when setting the $file
  and $line attribution that Logstash/Kibana report as "exception.file"
  use the same offset as the one that wfDeprecated() has computed from
  the back trace. This means it no longer (wrongly/uselessly) attributes
  all deprecation warnings to MWDebug.php.

* Trim the message suffix from "Called from <method> in <file>" to
  just "Called from <method>". This reduces noise and makes the message
  more stable over multiple MW branches. The stack trace is still there
  like before.

== Before (only with $wgDevelopmentWarnings) ==

> PHP Deprecated: Use of wfGetScriptUrl was deprecated in MediaWiki 1.35.
> [Called from MediaWiki::__construct in /var/mediawiki/includes/MediaWiki.php at line 67]
>
> Error from line 393 of /var/mediawiki/includes/debug/MWDebug.php
>
> #0 [internal function]: MWExceptionHandler::handleError()
> #1 /var/mediawiki/includes/debug/MWDebug.php(393): trigger_error()
> #2 /var/mediawiki/includes/debug/MWDebug.php(297): MWDebug::sendMessage()
> #3 /var/mediawiki/includes/debug/MWDebug.php(270): MWDebug::sendRawDeprecated()
> #4 /var/mediawiki/includes/GlobalFunctions.php(1032): MWDebug::deprecated()
> #5 /var/mediawiki/includes/GlobalFunctions.php(2548): wfDeprecated()
> #6 /var/mediawiki/includes/MediaWiki.php(67): wfGetScriptUrl(string)
> #7 /var/mediawiki/load.php(50): MediaWiki->__construct()

== After (always) ==

> Use of wfGetScriptUrl was deprecated in MediaWiki 1.35. [Called from MediaWiki::__construct]
>
> Error from line 67 of /var/mediawiki/includes/MediaWiki.php
>
> #0 [internal function]: MWExceptionHandler::handleError()
> #1 /var/mediawiki/includes/debug/MWDebug.php(293): trigger_error()
> #2 /var/mediawiki/includes/debug/MWDebug.php(270): MWDebug::sendRawDeprecated()
> #3 /var/mediawiki/includes/GlobalFunctions.php(1038): MWDebug::deprecated()
> #4 /var/mediawiki/includes/GlobalFunctions.php(2548): wfDeprecated()
> #5 /var/mediawiki/includes/MediaWiki.php(67): wfGetScriptUrl(string)
> #6 /var/mediawiki/load.php(50): MediaWiki->__construct()

Bug: T252923
Change-Id: I1d4a166b6dff8b0e19fce3fab409f4a89e734ee6
2020-07-17 00:06:42 +00:00
..
Hook Replace "@stable for implementation" with "@stable to implement" 2020-07-13 11:05:49 +02:00
BadRequestError.php Merge "Replace "@stable for subclassing" with "@stable to extend"" 2020-07-13 09:31:38 +00:00
BadTitleError.php Replace "@stable for calling" by "@stable to call" 2020-07-13 08:55:28 +00:00
CannotCreateActorException.php Mark exceptions as @newable 2020-07-08 17:51:38 +00:00
ErrorPageError.php Merge "Replace "@stable for subclassing" with "@stable to extend"" 2020-07-13 09:31:38 +00:00
FatalError.php Replace "@stable for subclassing" with "@stable to extend" 2020-07-13 11:00:30 +02:00
HttpError.php Merge "Replace "@stable for subclassing" with "@stable to extend"" 2020-07-13 09:31:38 +00:00
ILocalizedException.php Replace "@stable for implementation" with "@stable to implement" 2020-07-13 11:05:49 +02:00
LocalizedException.php Merge "Replace "@stable for subclassing" with "@stable to extend"" 2020-07-13 09:31:38 +00:00
MWContentSerializationException.php Mark exceptions as @newable 2020-07-08 17:51:38 +00:00
MWException.php Merge "Replace "@stable for subclassing" with "@stable to extend"" 2020-07-13 09:31:38 +00:00
MWExceptionHandler.php debug: Use native E_USER_DEPRECATED instead of custom channel 2020-07-17 00:06:42 +00:00
MWExceptionRenderer.php Fix more PSR12.Properties.ConstantVisibility.NotFound 2020-05-15 00:33:32 +01:00
MWUnknownContentModelException.php Replace "@stable for calling" by "@stable to call" 2020-07-13 08:55:28 +00:00
PermissionsError.php Replace "@stable for calling" by "@stable to call" 2020-07-13 08:55:28 +00:00
ProcOpenError.php Replace "@stable for calling" by "@stable to call" 2020-07-13 08:55:28 +00:00
ReadOnlyError.php Replace "@stable for calling" by "@stable to call" 2020-07-13 08:55:28 +00:00
ShellDisabledError.php Replace "@stable for calling" by "@stable to call" 2020-07-13 08:55:28 +00:00
ThrottledError.php Replace "@stable for calling" by "@stable to call" 2020-07-13 08:55:28 +00:00
UserBlockedError.php Replace "@stable for calling" by "@stable to call" 2020-07-13 08:55:28 +00:00
UserNotLoggedIn.php Replace "@stable for calling" by "@stable to call" 2020-07-13 08:55:28 +00:00