Last modified: 2010-04-24 12:01:32 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T20771, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 18771 - List possible errors in action=paraminfo
List possible errors in action=paraminfo
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
API (Other open bugs)
unspecified
All All
: Normal enhancement (vote)
: ---
Assigned To: Sam Reed (reedy)
http://www.mediawiki.org/wiki/API:Err...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-05-11 17:29 UTC by Umherirrender
Modified: 2010-04-24 12:01 UTC (History)
4 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Umherirrender 2009-05-11 17:29:02 UTC
I am missing a listing of all possible errors with his description which can be thrown by api.

With this information the programmer can handled all errors in the right place.

Maybe allow listing of all errors for each module.

Thanks.
Comment 1 Roan Kattouw 2009-05-11 19:45:03 UTC
(In reply to comment #0)
> I am missing a listing of all possible errors with his description which can be
> thrown by api.
> 
> With this information the programmer can handled all errors in the right place.
> 
> Maybe allow listing of all errors for each module.
> 
> Thanks.
> 

This is already documented per-module, at each module's description page. Listing this stuff through action=paraminfo was a suggestion Trevor also made a few weeks ago, so I'll repurpose the bug for that.
Comment 2 Sam Reed (reedy) 2010-02-09 22:45:46 UTC
Roan, any thoughts on how to implement this?

Something i can keep poking at when i get 5 minutes etc..

ApiLogin

	public function getErrors() {
		return array (
			'NoName' => 'You didn't set the lgname parameter',
			'Illegal' => ' You provided an illegal username',
			'NotExists' => ' The username you provided doesn't exist',
			'EmptyPass' => ' You didn't set the lgpassword parameter or you left it empty',
			'WrongPass' => ' The password you provided is incorrect',
			'WrongPluginPass' => 'Same as `WrongPass", returned when an authentication plugin rather than MediaWiki itself rejected the password',
			'CreateBlocked' => 'The wiki tried to automatically create a new account for you, but your IP address has been blocked from account creation',
			'Throttled' => 'You've logged in too many times in a short time',
			'Blocked' => 'User is blocked',
			'mustbeposted' => 'The login module requires a POST request'
		);
	}
Comment 3 Sam Reed (reedy) 2010-02-11 01:14:46 UTC
r62282 is the start of an implementation for this..

ApiBlock partially done...
Comment 4 Sam Reed (reedy) 2010-02-11 23:40:54 UTC
Ok, this bug is "implemented"..

The ApiBase is setup, and just needs expanding out further to document the rest of the modules
Comment 5 Sam Reed (reedy) 2010-02-13 01:47:29 UTC
Nice range of revisions between r62282 and r62415

Thats done most of the work...

ApiBase.php
array( 'code' => 'invalidparammix', 'info' => 'The parameters ' . implode( ', ',  $intersection ) . ' can not be used together' ), 
array( 'code' => 'missingparam', 'info' => 'One of the parameters ' . implode( ', ', array_shift( func_get_args() ) ) . ' is required' ),
array( 'code' => 'badtimestamp_{$encParamName}', 'info' => "Invalid value '$value' for timestamp parameter $encParamName" ),
array( 'code' => 'baduser_{$encParamName}', 'info' => "Invalid value for user parameter $encParamName" ),
array( 'code' => 'multival_$valueName', 'info' => "Only one $possibleValues is allowed for parameter '$valueName'" ),
array( 'code' => 'unknown_$valueName', 'info' => "Unrecognized value for parameter '$valueName': {$valuesList[0]}" ),

Are still to be done

And, this is only the "top level" stuff.. Not anything (bar the login module...)

Did show there are seemingly quite a few duplicated messages that should be removed and put into the message map.... (Another TODO)
Comment 6 Sam Reed (reedy) 2010-02-17 00:18:41 UTC
This is done in at least the core (ie used by WMF) extensions too...


So bar actually drilling into sub modules to list their errors, this is all but done..
Comment 7 Sam Reed (reedy) 2010-04-24 12:01:32 UTC
Resolving as fixed. Should be enough information there now, still, any other modules that may propagate errors up won't be included, but we'll be there for ever

If you need anything extra specifically documentating, just open a new bug and we can do it on a case by case basis

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links