Don't throw away user's text when rate limit is exceeded
When a page save fails due to a rate limit being exceeded, show an error message and the edit form with the submitted text, instead of throwing away the submitted text. Most error display in EditPage is done in showHeader(), hence the lack of examples to follow here in handleStatus(). PermissionsError has a bunch of useful logic so is not easily replaced, and permissions errors may also be shown before save. ReadOnlyError handling is duplicated in edit() and showHeader() so the exception here is usually not thrown. Change-Id: I7cb268fb6e20888cddef73d0ee9b0bf060ccafda
This commit is contained in:
parent
e6e35021d4
commit
93a51c3337
1 changed files with 4 additions and 1 deletions
|
|
@ -2023,7 +2023,10 @@ class EditPage implements IEditObject {
|
|||
throw new ReadOnlyError;
|
||||
|
||||
case self::AS_RATE_LIMITED:
|
||||
throw new ThrottledError();
|
||||
$out->wrapWikiTextAsInterface( 'error',
|
||||
wfMessage( 'actionthrottledtext' )->plain()
|
||||
);
|
||||
return true;
|
||||
|
||||
case self::AS_NO_CREATE_PERMISSION:
|
||||
$permission = $this->mTitle->isTalkPage() ? 'createtalk' : 'createpage';
|
||||
|
|
|
|||
Loading…
Reference in a new issue