aboutsummaryrefslogtreecommitdiffstats
path: root/includes/db/DatabaseError.php
Commit message (Collapse)AuthorAgeFilesLines
* Improve DBReadOnlyError/DBExpectedError page titleAaron Schulz2015-10-261-0/+7
| | | | | | Previously it was just "internal error". Change-Id: I70d81dfc628b462ab525d83f4a20d899da8ca143
* Make DBReadOnlyError extend DBExpectedErrorAaron Schulz2015-10-241-1/+1
| | | | | | This makes the output formatting a bit prettier Change-Id: I5d5c5a421326029323ef367feac70179ecb2d9e1
* Enforce lagged-slave read-only mode on the DB layerAaron Schulz2015-10-051-0/+6
| | | | | | | | | | * Most callers gracefully check wfReadOnly(), but fail in case they dont. This also catches foreign DBs which might slip through the cracks. * Also remove useless wfDebug() call around mDoneWrites check as write queries show in the logs anyway. Change-Id: I560ebd19c4eb2b3a040d4331702346440617cfaa
* Avoid update.php suggestion on DB connection errorsAaron Schulz2015-08-071-6/+13
| | | | | Bug: T98788 Change-Id: I21974d6b775f13c33055f76c30142e937eb0e965
* Updated some try-catch statements: MWException -> ExceptionAaron Schulz2015-01-091-1/+1
| | | | Change-Id: I76601a86e30f4984e3b1a8c8ec5ef5a0f652433a
* Use a more generic DB Error wordingFlorianschmidtwelzow2014-12-271-2/+2
| | | | | | | | | | Not everytime there is a problem to _contact_ the database server (e.g. a false server), sometimes (e.g. a false password or username) it's a problem of the user credentials or that the database does not exist. So use a more generic wording, just saying, that the database could not be accessed. Bug: T76317 Change-Id: I502d5894acb855ac51c6f45ea91e5446b4b3aeb3
* Revert "Replace wfMsgReplaceArgs by RawMessage"Anomie2014-09-291-4/+2
| | | | | | | | This was merged too quickly, has several issues. This reverts commit 6abefb274ff9cd86f75d5d13f713e1971e1b27ce. Change-Id: Ibf3e464fa9eb534d599274dd9262a30d5a6a6948
* Replace wfMsgReplaceArgs by RawMessageumherirrender2014-09-291-2/+4
| | | | | | | | | | The replace of $n params can also be done using the Message class. In case there are no message keys, the RawMessage class is used. Deprecated wfMsgReplaceArgs, but added no warning, because it is used in some extensions and from deprecated functions Change-Id: I62091b09e4490e59ed7258566e0ddf2f8ee799d2
* Deprecate HTMLFileCache::newFromTitle() in favor of constructorMax Semenik2014-09-191-1/+1
| | | | Change-Id: I903e68fc1f486501d790ca69146ecb835d90c9cc
* DBConnectionError: Expand {{SITENAME}} in pagetitle with Message::text()Kevin Israel2014-05-261-6/+2
| | | | | | | | Follows-up 485ff9ead94b by making the same change in DBConnectionError, which overrides MWException::msg() to not use database messages. Bug: 58447 Change-Id: Iafa9dd741f1f099a4a6cfb8cf655b7d5f504011a
* Made DB errors go to the exception log againAaron Schulz2014-04-281-8/+0
| | | | | | | | | * Some DB errors are caught while others bubble up to users. It is useful to log the latter separately and it also provides more context. The exception logs have a backtrace where as the regular DB logs do not. Change-Id: I7ef7693d96e0258119f714e678099e4813ca0c94
* Fixed some @params documentation (includes/[db|installer])umherirrender2014-04-191-1/+1
| | | | | | | | | Swapped some "$var type" to "type $var" or added missing types before the $var. Changed some other types to match the more common spelling. Makes beginning of some text in captial. Also added some missing @param. Change-Id: I3595e9aac69ac42fbb74b0783fae0ad9bcc831aa
* Hide message for DBUnexpectedError exceptionsKevin Israel2014-03-041-3/+12
| | | | | | | | | | | | | DBUnexpectedErrors are now treated like most other exceptions; we now hide the error messages (which could contain sensitive information such as IP addresses) unless $wgShowExceptionDetails is true. In that case, the messages (and redacted backtraces) would be shown even if $wgShowDBErrorBacktrace is false, though hiding them would add complexity to the exception handler for little benefit. Bug: 26811 Change-Id: I063c241975ce5b12a04abc21821ac67c716b3d5e
* Update documentation for database related classesSiebrand Mazeland2014-01-061-16/+26
| | | | Change-Id: I364e192e2624f89a91dcb19e371ce3412142a95f
* Stop using the unholy trinity in DatabaseErrorChad Horohoe2014-01-021-6/+6
| | | | | | | RequestContext::getMain() shifts the blame, but at least it's one less place in core. Change-Id: I36ffad0ff2703c3326690eef2c07ef66aa532210
* Break long lines and formatting updates for includes/db/Siebrand Mazeland2013-11-211-6/+23
| | | | | | Fix all line length related CodeSniffer warnings. Change-Id: Id0fd8f4c7276185f51489659ee3cd06962fbc16d
* Update formatting on database-related classesSiebrand Mazeland2013-11-211-3/+6
| | | | Change-Id: I91f83e28ae25f80ba9e36c612f1ad050ffa1573c
* exception: Use MWExceptionHandler::logException in more placesTimo Tijhof2013-10-301-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Most code replaced wasn't exactly like what logException does but most probably should be. A few implementation differences with the code it replaced in various places: * MWException if-guards Was there only to prevent a crash because getLogMessage is an MWException method. Now that logException is generic, it seems sensible to start logging those as well (follows-up a97f3550a0). * Exception::getTraceAsString Now using MWExceptionHandler::formatRedactedTrace instead. It wasn't using it because that method didn't exist yet. Notes: * DatabaseError::getLogMessage Removed as this override was no longer doing anything (we're using MWExceptionHandler::getLogMessage instead of $e->getLogMessage). Introduced isLoggable() to take over the responsibility of indicating when an exception should not be logged (follows-up bcb9f9e1c0d). * DeferredUpdates and Wiki.php Both specificy MWException. Though ApiMain intends to catch all and only logged MWException because it couldn't otherwise, these actually only catch MWException (as opposed to catching all and having an if-statement inside). Left those as-is to have them continue propagate other exceptions. * JobQueueFederated and JobQueueGroup All specify to catch JobQueueError only. Not sure whether it should catch other exceptions. It now can, but I'll leave it as is in case it intends to have those be handled elsewhere (or fatal). Change-Id: I4578a0fe7d95a080f1a3b292ce7ae73a4d5fcaca
* Exception: Clean up html document for error pagesTimo Tijhof2013-10-301-37/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Interface: * Restore sitename as part of error page document title (follows-up 4ca9805). Moved to general Exception class as it is useful in general, this effectively changes the title from "This wiki has a problem" to "Internal error - Wikipedia". * Added basic <style> to have it use a sans-serif font and a bit padding to offset it from the edge of the window. * Output stacktrace in <pre> as-is (with linebreaks) instead of in a <p> with <br/>. Clean up: * Removed spurious "<!-- SiteSearch Google -->" comment. * Change sitesearch radio button to not need the id/for attributes but simply nest them. Visual rendering and browser behaviour is identical. * Renamed $text to $html since that is what it is (follows-up 4ca9805 which reused that variable for html, it used to contain text). * Remove odd linebreak from "dberr-problems" message, it was being output as-is in the html (html escaped, of course) and line breaks have no meaning inside an <h1> tag. Using a simple space instead. Visual rendering is identical. Coding style: * Using <!DOCTYPE html> instead of <!doctype html> for consistency with other documents we output. * Switched a few inline #-style comments to use // instead. * Switched a few strings from double quotes to single quotes in areas close to the changed code. Change-Id: I33232d871200cbd23501c9a6c5f8a178931e135e
* Hide server IP addresses from DB error pagesKevin Israel2013-09-031-63/+131
| | | | | | | | | | | | | | | | | | | | Error details are now omitted if both $wgShowHostnames and $wgShowSQLErrors are false. WMF wikis have the former set to true; users of those wikis can still include the details in bug reports. Fixing this for DBConnectionError was more or less straightforward. However, in the case of DBQueryError, this involved splitting the error message into multiple smaller messages (killing a raw HTML message in the process). Note that this is an incomplete fix: information disclosure is, for now, still possible from DBUnexpectedError exceptions (are these even supposed to go into the exception log?) or exceptions that occur from within the exception handler. Yet this is still an improvement. Bug: 26811 Change-Id: I1756b296d5e8d1d22511a3c3b58b5bb0dd025fec
* Added/Removed spaces around string concatenationumherirrender2013-04-131-1/+1
| | | | | | | | | And added/removed spaces around some other tokens, like +, -, *, /, <, >, =, ! Fixed windows newline style Change-Id: I0b9c8c408f3f6bfc0d685a074d7ec468fb848fc8
* (Bug 42461) Remove call to "new Database()"Platonides2013-03-181-4/+4
| | | | | | | | * Refactored LoadBalancer::reportConnectionError() * Removed PHP4-style reference from DatabaseError constructors * Allowed to not pass a database to the DBError family of exceptions. Change-Id: If9570b45ea7285de2b8b2391e704bc01f76be48a
* Fixed @param tags to conform with Doxygen format.Tyler Anthony Romeo2013-03-111-1/+1
| | | | | | | | | | | Doxygen expects parameter types to come before the parameter name in @param tags. Used a quick regex to switch everything around where possible. This only fixes cases where a primitve variable (or a primitive followed by other types) is the variable type. Other cases will need to be fixed manually. Change-Id: Ic59fd20856eb0489d70f3469a56ebce0efb3db13
* fix some spacingumherirrender2013-03-071-1/+1
| | | | | | | | Added/removed spaces around logical/arithmetic operator Reduced multiple empty lines to one empty line Removed wrong tabs before comments at end of line Removed too many spaces in assigments Change-Id: I2bba4e72f9b5f88c53324d7b70e6042f1aad8f6b
* fix some spacingumherirrender2013-02-041-4/+4
| | | | Change-Id: I670a7baf3ba1e70d18346bb00938d518ba2063bd
* fix some spacingumherirrender2013-01-261-1/+1
| | | | Change-Id: Id7eda67a43f9040117edd79fdbeb678f1c3a6da2
* Use wfMessage instead of deprecated wfMsg*Alex Monk2012-08-181-1/+1
| | | | | | Or $this->msg in special pages. Change-Id: I774a89d646615053c8424050e42ad95601f92543
* (bug 37138) Fix broken Google sitesearch in DatabaseErrorTimo Tijhof2012-06-051-2/+2
| | | | Change-Id: I31dc64f83ce8767dcdd84597844b0819840f60e1
* Added missing GPLv2 headers in includes/db.Alexandre Emsenhuber2012-04-261-0/+21
| | | | Change-Id: Ib8fe301c6db77603e411113cea5a39c25c664961
* rv r87948 "fix backtrace on SQL error"Antoine Musso2012-01-301-4/+0
| | | | | | | | | | | Looks unneeded nowaday. Backtrace is correctly appended to HTML output or CLI output when $wgShowDBErrorBacktrace is true. Not sure what it was supposed to fix. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/110308
* More documentation of parameters following up r104591Sam Reed2011-12-051-4/+4
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/105189
* Moar documentationsSam Reed2011-11-291-0/+16
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/104591
* Followup r102910Sam Reed2011-11-141-1/+1
| | | | | | | Make the link to the MW page https only Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/102965
* Bug 32379 - DatabaseError.php is hardcoding httpSam Reed2011-11-131-4/+4
| | | | | | | Also tidy up a couple of returns (per others in method, and/or parents) Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/102910
* * Let HTMLFileCache constructor take in a Title *or* a the prefixed dbkey ↵Aaron Schulz2011-11-021-4/+11
| | | | | | | | | itself. * Tweaked filecache fallback in fileCachedPage() to try the raw title param. If the DB is down, we can get most views of titles with colons in them to work this way. Previously, it could fail on an interwiki lookup. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/101667
* HTMLFileCache refactoring:Aaron Schulz2011-09-291-3/+3
| | | | | | | | | | | | * Rewrote class and split into three classes: a base class, and html cache and a more generic cache to be used later. * The new classes now use RequestContext. * Renamed fetchPageText() -> fetchText(). * Split out new saveText() function from saveToFileCache(). * Various other cleanups and fixes. Also fixed backwards setting of $wgDisableCounters in rebuildFileCache.php. Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/98405
* Moar documentationsSam Reed2011-09-161-0/+5
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/97301
* * Removed usage of error suppression operator in includes/dbAlexandre Emsenhuber2011-07-041-3/+3
| | | | | | | * Changed an usage of $_REQUEST to $wgRequest Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/91409
* Fix for r86722: pass the message 'dberrortext' unescaped to the output since ↵Alexandre Emsenhuber2011-06-231-5/+10
| | | | | | | it contains. I really don't like to pass unescaped messages to the output *sigh* Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/90668
* More documentation stuffsSam Reed2011-05-251-0/+32
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/88816
* DocumentationSam Reed2011-05-251-4/+5
| | | | Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/88812
* Move DB(.*?)Error classes into own fileSam Reed2011-05-251-0/+276
Updated AutoLoader to match Notes: http://mediawiki.org/wiki/Special:Code/MediaWiki/88800