Commit graph

35 commits

Author SHA1 Message Date
Juan Osorio
1d930860cc Removes Google web search from exception page
When a wiki is down, it is not necessarily useful to be able to
search the web. Additionally, there is general consensus that
the hard-coded Google search form should be removed.

Bug: T208871
Change-Id: I5bcae848de1144d4fc1116c475b2e2ab1ccc3f7d
2018-11-13 15:47:42 +00:00
Fomafix
1472f02b36 Phabricator: Use Tddddd instead of Bug ddddd in comments
Change-Id: Ic9fe03cab270bd6be738af346164ad5d31a0d780
2018-10-04 09:15:02 +02:00
Timo Tijhof
9512ebe736 exception: Add FIXME about code duplication
These methods aren't identical, so consolidation isn't
immediately obvious, and creating dependencies is problematic
in error handling code given there is a lot of pressure on this
code to not by itself cause additional errors.

This means that maybe it's best to keep these inlined without
duplication, but at the very least we then need to remember
to keep these in sync. This duplication has been around for
a while now, but documentation can never come too late...

Change-Id: I60160f61c13c8e115d839acce222f110e30bc2f2
2018-09-28 22:17:07 +00:00
Timo Tijhof
8476ec3cb8 exception: Avoid preg_replace for literal swap
Follows-up bbcbcaba3d.

Change-Id: Ie7b76c28ba53668d73a8435c4d2ec91757bd2372
2018-09-27 17:39:42 +01:00
Brian Wolff
bbcbcaba3d Fix html <title> for exceptions during message parsing.
Previously an ugly {{SITENAME}} would show up for exceptions
that happened in the middle of processing a message

Change-Id: I4e3b675673dc3b74f89e4325f6a0a8b44162f478
2018-09-01 20:19:45 +00:00
Bill Pirkle
807125abdb Deprecate $wgShowSQLErrors and $wgShowDBErrorBacktrace and make nonfunctional
Clarify and simplify exception output by deprecating
$wgShowSQLErrors and wgShowDBErrorBacktrace.
$wgShowExceptionDetails will now control most related output.
$wgShowHostnames will now solely control output of
MWExceptionRenderer::reportOutageHTML.

Bug: T165768
Change-Id: Idead2c11c499463dfa6293c3d4b33be3bde92e1a
2018-07-25 10:38:19 -05:00
Strainu
94b58b2c26 MWExceptionRenderer: Fix db error outage page
Set content encoding and add some content to the header tag.

Bug: T195525
Change-Id: Ieabfe18280359459e9462204371d3fe8d62a4177
2018-06-15 22:21:16 +02:00
Umherirrender
3124a990a2 Use ::class to resolve class names in includes files
This helps to find renamed or misspelled classes earlier.
Phan will check the class names

Change-Id: I07a925c2a9404b0865e8a8703864ded9d14aa769
2018-01-27 20:34:29 +01:00
jenkins-bot
9219588de6 Merge "MWExceptionRenderer: Wrap error message in a paragraph" 2017-11-15 10:38:43 +00:00
Brian Wolff
fea3bbcdae SECURITY: Escape internal error message
This message contains the request url, which is semi-user controlled.
Most browsers percent escape < and > so its probably not exploitable
(curl is an exception here), but nonetheless its not good.

Bug: T178451
Change-Id: I19358471ddf1b28377aad8e0fb54797c817bb6f6
2017-11-15 00:58:44 +00:00
Bartosz Dziewoński
7e3f457e80 MWExceptionRenderer: Wrap error message in a paragraph
Bug: T180284
Change-Id: I71563fd6932d35c7298b185bd7c05c8f1dce63f8
2017-11-13 13:39:53 +01:00
Umherirrender
3f1a52805e Use short type bool/int in param documentation
Enable the phpcs sniffs for this and used phpcbf

Change-Id: Iaa36687154ddd2bf663b9dd519f5c99409d37925
2017-08-20 13:20:59 +02:00
jenkins-bot
06d611a399 Merge "Remove newline at end of MWExceptionRenderer::getShowBacktraceError" 2017-07-18 19:23:40 +00:00
Fomafix
6d0111186f Remove newline at end of MWExceptionRenderer::getShowBacktraceError
Also add a period at the end of the sentence.

This changes the HTML comment from

<!-- Set $wgShowExceptionDetails = true; at the bottom
of LocalSettings.php to show detailed debugging
information
 -->

to

<!-- Set $wgShowExceptionDetails = true; at the bottom
of LocalSettings.php to show detailed debugging
information. -->

This is a follow-up to 842b7a1769 (T162315).

Change-Id: I45ff4f856ad1c0dc72066fce7771077ff4663785
2017-07-18 12:26:44 +02:00
Fomafix
15fb994130 Avoid double HTML encoding
Html:element() already makes an HTML encoding. The additional
htmlspecialchars is not necessary.

Change-Id: If0530c3d3cb0d3cc61e849a1c84ae0d68c242517
2017-07-03 17:55:15 +02:00
Aaron Schulz
82e2c924e4 Remove "@author Aaron Schulz" annotations
Bug: T139301
Change-Id: Ib5248e8e27d60611c7373bce4b29dd5e85aa3489
2017-06-27 15:24:14 -07:00
Alex Monk
f8b8d2689d MWExceptionRenderer::useOutputPage: Don't bother if we have no Title context
Change-Id: Ieb6d682a9f2fb4def4c01908ccd035fcce2e1895
2017-05-31 22:52:46 +00:00
Gergő Tisza
fcd495ffef Remove $wgExceptionHooks
Skip deprecation period because it is very unlikely that anyone used this:
it does not appear anywhere on gerrit/git, no nontrivial google hits,
the documentation has been flat out wrong for 9 years and no one
noticed it, and the whole feature is fairly useless as you need to declare
it separately for every single exception class you expect.

Change-Id: I85844a238d3135d05eeba10331149624b04bafe2
2017-05-22 00:57:44 +02:00
jenkins-bot
2ecb96a96f Merge "exception: Add newline at the end of a debugging line for CLI users" 2017-04-26 21:35:33 +00:00
Florian Schmidt
842b7a1769 exception: Add newline at the end of a debugging line for CLI users
Bug: T162315
Change-Id: Ia2963fa298ab0e4782ef823e7f53322cd6a9c99b
2017-04-26 21:26:13 +00:00
jenkins-bot
2d71bf187d Merge "Send 500 http status code, instead of 200, for DBConnectionErrors" 2017-04-22 02:08:09 +00:00
Florian Schmidt
2c1dc398be Send 500 http status code, instead of 200, for DBConnectionErrors
Bug: T160875
Change-Id: I4c909457938a19358dfc4b2aec216b1a148df46c
2017-04-21 11:55:36 +00:00
Aaron Schulz
dd359741cc Move DB errors to Rdbms namespace
Change-Id: I463bd86123501abc68fdb78b4cda6110f7af2549
2017-04-15 10:47:41 -07:00
Huji Lee
0136242734 Always show exceptions of type 'error' in LTR
Bug: T153027
Change-Id: Iad5b9a01f5b8cdaa2ed94b3ece937acc1f6faa60
2016-12-12 20:23:41 -05:00
Aaron Schulz
0a615dd414 Include getPublicLogMessage() in double-exception messages
Change-Id: I364e237f859d65fdcc29025c63c90ac2e0b96718
2016-11-21 22:18:53 -08:00
jenkins-bot
5433c9357d Merge "Replace wgShowExceptionDetails with wgShowDBErrorBacktrace on db errors" 2016-11-21 22:27:38 +00:00
Reedy
57a1e7b270 Replace wgShowExceptionDetails with wgShowDBErrorBacktrace on db errors
Bug: T148957
Change-Id: I8891369156547e8931463a2fd55995cfa9e98ee7
2016-11-21 22:07:03 +00:00
Chad Horohoe
524e624637 Exception renderer: Remove useless check for isCommandLine()
If we're on the cli, we would've never hit this else block

Change-Id: Idff009ab255b1907f752e0c6b5652715923b0ed7
2016-11-21 13:47:09 -08:00
Aaron Schulz
97b5aa9a11 Exception rendering fixes
* Actually use MWExceptionRenderer::AS_RAW. Use this after
  an error is thrown while trying to pretty render the original
  error. This is how this case was originally handled before.
* Do not show the google form or file cache in CLI mode.

Change-Id: I130499753efbf8b4d6d254ea36bacb2473952c1b
2016-09-30 16:57:48 -07:00
Max Semenik
2b51bd1847 Fix function name case
Change-Id: Ibd4f682d2ed8500a50d85aae38f17281646f7c2d
2016-09-26 15:32:54 -07:00
Aaron Schulz
cb9901ef41 Fix "MWExceptionRenderer::getText() should not be called statically" errors
Change-Id: Icfb65795b1455217ca9bc2c1f7cd453144ad5106
2016-09-19 10:55:10 -07:00
Brad Jorsch
0b93d767ea Make MWExceptionRenderer work with PHP7's exception changes
See https://wiki.php.net/rfc/throwable-interface

Change-Id: Ib65f912580f5d84997c5926e7f602d5f5ef3faba
2016-09-19 12:40:36 -04:00
Aaron Schulz
3ad9e41be9 Fix $wgFileCache DB outage fallback
Change-Id: I5c41b4669ca29d119de5c08a2c61dbadae7cf55c
2016-09-16 02:18:12 +00:00
Aaron Schulz
5820c6dcac Exception cleanups for LoadBalancer
* Make the error message itself be dumb/raw.
* Make the exception exposer show the same GUI message.
* Remove overzelous wgLang check in MWExceptionRenderer.

Change-Id: Ifffff3b3cc785ea3080e4975efe33b3c2cf304d6
2016-09-15 01:32:43 +00:00
Aaron Schulz
00bee02971 Add MWExceptionRenderer class and decouple DBError
* This handles the work of showing exceptions so that
  MWException does not have too.
* Simplify the DBError classes to regular Exception
  classes. Lots of pointless prettification has been
  removed, but DBConnectionError still gets the usual
  special treatment of a fallback page and Google form.
* Remove hacky file cache fallback code that probably
  did not work.
* Make MWExceptionHandler::report() wrap
  MWExceptionExposer::output().
* Make MWException::runHooks() wrap
  MWExceptionExposer::runHooks().

Change-Id: I5dfdc84e94ddac65417226cf7c84513ebb9f9faa
2016-09-14 11:53:55 -07:00