Jump to content
MediaWiki

API:Errors and warnings: Difference between revisions

From mediawiki.org
Content deleted Content added
Line 36: Line 36:
</syntaxhighlight>
</syntaxhighlight>
</div>
</div>
(<code>*</code> will be replaced with <code>text</code> when <code>formatversion=2</code> is used.)
(追記) <translate> (追記ここまで)((追記) <tvar name=1> (追記ここまで)<code>*</code(追記) ></tvar (追記ここまで)> will be replaced with (追記) <tvar name=2> (追記ここまで)<code>text</code(追記) ></tvar (追記ここまで)> when (追記) <tvar (追記ここまで) (追記) name=3> (追記ここまで)<code>formatversion=2</code(追記) ></tvar (追記ここまで)> is used.)(追記) </translate> (追記ここまで)


<translate>
<translate>
Line 44: Line 44:
!<translate><!--T:11--> Type</translate> !! <translate><!--T:12--> Description</translate> !!style="width:40%"|<translate><!--T:13--> Warning message(s)</translate>
!<translate><!--T:11--> Type</translate> !! <translate><!--T:12--> Description</translate> !!style="width:40%"|<translate><!--T:13--> Warning message(s)</translate>
|-
|-
| Disabled submodule || The <code>action=query</code> submodule has been [[API:Restricting_API_usage#Disabling_modules|disabled]] in the wiki. To check if a module is available before invoking it, see [[API:FAQ#check_if_an_API_module_is_available?|How do I check if an API module is available?]] in the FAQ.
| (追記) <translate> (追記ここまで)Disabled submodule(追記) </translate> (追記ここまで) || (追記) <translate> (追記ここまで)The (追記) <tvar name=1> (追記ここまで)<code>action=query</code(追記) ></tvar (追記ここまで)> submodule has been [[(追記) <tvar name=2>Special:MyLanguage/ (追記ここまで)API:Restricting_API_usage#Disabling_modules(追記) </tvar> (追記ここまで)|disabled]] in the wiki.(追記) </translate> (追記ここまで) (追記) <translate> (追記ここまで)To check if a module is available before invoking it, see [[(追記) <tvar name=1>Special:MyLanguage/ (追記ここまで)API:FAQ#check_if_an_API_module_is_available?(追記) </tvar> (追記ここまで)|How do I check if an API module is available?]] in the FAQ.(追記) </translate> (追記ここまで)
||The ''submodulename'' module has been disabled.
||(追記) <translate> (追記ここまで)The ''submodulename'' module has been disabled.(追記) </translate> (追記ここまで)
|-
|-
| Missing submodule || The <code>list</code>, <code>prop</code> or <code>meta</code>(削除) (削除ここまで) submodule is not present in the wiki, for example if it is implemented by an extension that isn't loaded. || Unrecognized value for parameter ''list=submodule''.
| (追記) <translate> (追記ここまで)Missing submodule(追記) </translate> (追記ここまで) || (追記) <translate> (追記ここまで)The (追記) <tvar name=1> (追記ここまで)<code>list</code(追記) ></tvar (追記ここまで)>, (追記) <tvar name=2> (追記ここまで)<code>prop</code(追記) ></tvar (追記ここまで)> or (追記) <tvar name=3> (追記ここまで)<code>meta</code>(追記) </tvar> (追記ここまで) submodule is not present in the wiki, for example if it is implemented by an extension that isn't loaded.(追記) </translate> (追記ここまで) || (追記) <translate> (追記ここまで)Unrecognized value for parameter ''list=submodule''.(追記) </translate> (追記ここまで)
|-
|-
| Parameter validation || Warnings thrown when validating parameters of any API module. ''paramname'' is replaced by the name of the parameter.||
| (追記) <translate> (追記ここまで)Parameter validation(追記) </translate> (追記ここまで) || (追記) <translate> (追記ここまで)Warnings thrown when validating parameters of any API module.(追記) </translate> (追記ここまで) (追記) <translate> (追記ここまで)''paramname'' is replaced by the name of the parameter.(追記) </translate> (追記ここまで)||
* Too many values supplied for parameter ''paramname'': the limit is ''limit''.
* (追記) <translate> (追記ここまで)Too many values supplied for parameter ''paramname'': the limit is ''limit''.(追記) </translate> (追記ここまで)
* Unrecognized value for parameter ''paramname'': ''value''.
* (追記) <translate> (追記ここまで)Unrecognized value for parameter ''paramname'': ''value''.(追記) </translate> (追記ここまで)
* Unrecognized values for parameter ''paramname'': ''value1, value2, value3''
* (追記) <translate> (追記ここまで)Unrecognized values for parameter ''paramname'': ''value1, value2, value3''(追記) </translate> (追記ここまで)
|}
|}


<translate>
== Errors ==
== Errors ==

=== Error formats ===
=== Error formats ===
</translate>
(削除) Since MediaWiki 1.29 errors are localizable, and available in multiple formats. (削除ここまで)An error (or warning) is expected to consist of a [[Manual:Messages_API|message]], an error code (an arbitrary string, usually generated from the message key; see also [[#Standard error messages]] below), and optional extra data (an associative array).(削除) An API response with errors will look like this: (削除ここまで)
<translate>Since MediaWiki 1.29 errors are localizable, and available in multiple formats.</translate>
(追記) <translate> (追記ここまで)An error (or warning) is expected to consist of a [[(追記) <tvar name=1>Special:MyLanguage/ (追記ここまで)Manual:Messages_API(追記) </tvar> (追記ここまで)|message]], an error code (an arbitrary string, usually generated from the message key; see also [[(追記) <tvar name=2>#Standard error messages</tvar>| (追記ここまで)#Standard error messages]] below), and optional extra data (an associative array).(追記) </translate> (追記ここまで)
<translate>An API response with errors will look like this:</translate>


<div style="width: 60%>
<div style="width: 60%>
Line 64: Line 69:
"errors": [
"errors": [
{
{
"code": "error-code",
"code": (追記) <translate nowrap> (追記ここまで)"error-code"(追記) </translate> (追記ここまで),
/* ...error message..., */
/* (追記) <translate nowrap> (追記ここまで)...error message...,(追記) </translate> (追記ここまで) */
"data": [ /* ...any extra data... */ ],
"data": [ /* (追記) <translate nowrap> (追記ここまで)...any extra data...(追記) </translate> (追記ここまで) */ ],
"module": "path to the API module that generated the error"
"module": (追記) <translate nowrap> (追記ここまで)"path to the API module that generated the error"(追記) </translate> (追記ここまで)
},
},
/* ...more errors... */
/* (追記) <translate nowrap> (追記ここまで)...more errors...(追記) </translate> (追記ここまで) */
],
],
"docref": "human-readable message on where to find help"
"docref": (追記) <translate nowrap> (追記ここまで)"human-readable message on where to find help"(追記) </translate> (追記ここまで)
}
}
</syntaxhighlight>
</syntaxhighlight>
</div>
</div>


The <code>data</code> key in the output above will be missing if there is no extra data to display.
(追記) <translate> (追記ここまで)The (追記) <tvar name=1> (追記ここまで)<code>data</code(追記) ></tvar (追記ここまで)> key in the output above will be missing if there is no extra data to display.(追記) </translate> (追記ここまで)


The way the error message in the output above is returned to the client is controlled by the <code>errorformat</code> API parameter.(削除) (削除ここまで)The various error formats available are:
(追記) <translate> (追記ここまで)The way the error message in the output above is returned to the client is controlled by the (追記) <tvar name=1> (追記ここまで)<code>errorformat</code(追記) ></tvar (追記ここまで)> API parameter.(追記) </translate> (追記ここまで)
(追記) <translate> (追記ここまで)The various error formats available are:(追記) </translate> (追記ここまで)
{| class="wikitable"
{| class="wikitable"
! Format !! Description !! Output
! (追記) <translate> (追記ここまで)Format(追記) </translate> (追記ここまで) !! (追記) <translate> (追記ここまで)Description(追記) </translate> (追記ここまで) !! (追記) <translate> (追記ここまで)Output(追記) </translate> (追記ここまで)
|-
|-
| html || Intended for human display in HTML-capable clients ||
| (追記) <translate> (追記ここまで)html(追記) </translate> (追記ここまで) || (追記) <translate> (追記ここまで)Intended for human display in HTML-capable clients(追記) </translate> (追記ここまで) ||
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
"html": "the message, interpreted as wikitext and parsed into HTML"
"html": "(追記) <translate nowrap> (追記ここまで)the message, interpreted as wikitext and parsed into HTML(追記) </translate> (追記ここまで)"
</syntaxhighlight>
</syntaxhighlight>
|-
|-
| wikitext || ||
| (追記) <translate> (追記ここまで)wikitext(追記) </translate> (追記ここまで) || ||
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
"text": "the message as-is, with parameter substitution but without any parsing"
"text": "(追記) <translate nowrap> (追記ここまで)the message as-is, with parameter substitution but without any parsing(追記) </translate> (追記ここまで)"
</syntaxhighlight>
</syntaxhighlight>
|-
|-
| plaintext || Intended for human display in HTML-incapable clients. Plaintext conversion is a minimal, best-effort transformation to make the message (assumed to contain wikitext) more readable: tags are removed, HTML entities are replaced, certain HTML tags are intelligently replaced with punctuation. ||
| (追記) <translate> (追記ここまで)plaintext(追記) </translate> (追記ここまで) || (追記) <translate> (追記ここまで)Intended for human display in HTML-incapable clients.(追記) </translate> (追記ここまで) (追記) <translate> (追記ここまで)Plaintext conversion is a minimal, best-effort transformation to make the message (assumed to contain wikitext) more readable: tags are removed, HTML entities are replaced, certain HTML tags are intelligently replaced with punctuation.(追記) </translate> (追記ここまで) ||
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
"text": "the message, like wikitext, but with added plaintext conversion"
"text": (追記) <translate nowrap> (追記ここまで)"the message, like wikitext, but with added plaintext conversion"(追記) </translate> (追記ここまで)
</syntaxhighlight>
</syntaxhighlight>
|-
|-
| raw || Intended as a machine-readable format (note that the error key is more unique than the error code). Parameters can themselves be objects with <code>key</code> and <code>params</code> fields. ||
| (追記) <translate> (追記ここまで)raw(追記) </translate> (追記ここまで) || (追記) <translate> (追記ここまで)Intended as a machine-readable format (note that the error key is more unique than the error code).(追記) </translate> (追記ここまで) (追記) <translate> (追記ここまで)Parameters can themselves be objects with (追記) <tvar name=1> (追記ここまで)<code>key</code(追記) ></tvar (追記ここまで)> and (追記) <tvar name=2> (追記ここまで)<code>params</code(追記) ></tvar (追記ここまで)> fields.(追記) </translate> (追記ここまで) ||
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
"key": "message key",
"key": (追記) <translate nowrap> (追記ここまで)"message key"(追記) </translate> (追記ここまで),
"params": [ /* ...message parameters... */ ]
"params": [ /* (追記) <translate nowrap> (追記ここまで)...message parameters...(追記) </translate> (追記ここまで) */ ]
</syntaxhighlight>
</syntaxhighlight>
|-
|-
| none ||colspan=2|No message information at all.
| (追記) <translate> (追記ここまで)none(追記) </translate> (追記ここまで) ||colspan=2|(追記) <translate> (追記ここまで)No message information at all.(追記) </translate> (追記ここまで)
|-
|-
| bc || The default, for '''b'''ackward '''c'''ompatibility. There’s no point in specifying this value, use one of the non-legacy formats instead. || See [[#Legacy format]]
| bc || (追記) <translate> (追記ここまで)The default, for (追記) <tvar name=1> (追記ここまで)'''b'''ackward '''c'''ompatibility(追記) </tvar> (追記ここまで).(追記) </translate> (追記ここまで) (追記) <translate> (追記ここまで)There’s no point in specifying this value, use one of the non-legacy formats instead.(追記) </translate> (追記ここまで) || (追記) <translate> (追記ここまで)See [[(追記) <tvar name=1>#Legacy format</tvar>| (追記ここまで)#Legacy format]](追記) </translate> (追記ここまで)
|}
|}


For the formatting modes which involve message lookup (<code>html</code>, <code>wikitext</code> and <code>plaintext</code>) the API parameter <code>errorlang</code> can be used to set the language (only needed when different from the content language) and <code>errorsuselocal</code> to set whether the MediaWiki: namespace can be used to override default error messages.
(追記) <translate> (追記ここまで)For the formatting modes which involve message lookup ((追記) <tvar name=1> (追記ここまで)<code>html</code(追記) ></tvar (追記ここまで)>, (追記) <tvar name=2> (追記ここまで)<code>wikitext</code(追記) ></tvar (追記ここまで)> and (追記) <tvar name=3> (追記ここまで)<code>plaintext</code(追記) ></tvar (追記ここまで)>) the API parameter (追記) <tvar name=4> (追記ここまで)<code>errorlang</code(追記) ></tvar (追記ここまで)> can be used to set the language (only needed when different from the content language) and (追記) <tvar name=5> (追記ここまで)<code>errorsuselocal</code(追記) ></tvar (追記ここまで)> to set whether the MediaWiki: namespace can be used to override default error messages.(追記) </translate> (追記ここまで)


Error codes are also returned in the <code>MediaWiki-API-Error</code> response HTTP header, separated by commas when there are multiple errors.
(追記) <translate> (追記ここまで)Error codes are also returned in the (追記) <tvar name=1> (追記ここまで)<code>MediaWiki-API-Error</code(追記) ></tvar (追記ここまで)> response HTTP header, separated by commas when there are multiple errors.(追記) </translate> (追記ここまで)


For an example error response or to test your client's error handling, visit https://en.wikipedia.org/w/api.php?action=blah&errorformat=plaintext&format=jsonfm&formatversion=2
(追記) <translate> (追記ここまで)For an example error response or to test your client's error handling, visit (追記) <tvar name=1> (追記ここまで)https://en.wikipedia.org/w/api.php?action=blah&errorformat=plaintext&format=jsonfm&formatversion=2(追記) </tvar></translate> (追記ここまで)


When <code>errorformat</code> is not set (or set to <code>bc</code>), errors will be displayed in the legacy format instead.
(追記) <translate> (追記ここまで)When (追記) <tvar name=1> (追記ここまで)<code>errorformat</code(追記) ></tvar (追記ここまで)> is not set (or set to (追記) <tvar name=2> (追記ここまで)<code>bc</code(追記) ></tvar (追記ここまで)>), errors will be displayed in the legacy format instead.(追記) </translate> (追記ここまで)


<translate>
==== Legacy format ====
==== Legacy format ====
</translate>
In the legacy error format, there is always at most one error; additional ones are discarded.(削除) The response looks like this: (削除ここまで)
(追記) <translate> (追記ここまで)In the legacy error format, there is always at most one error; additional ones are discarded.(追記) </translate> (追記ここまで)
<translate>The response looks like this:</translate>
<div style="width: 60%>
<div style="width: 60%>
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
{
{
"error": {
"error": {
"code": "error-code",
"code": (追記) <translate nowrap> (追記ここまで)"error-code"(追記) </translate> (追記ここまで),
"info": "the message as-is, with parameter substitution but without any parsing",
"info": (追記) <translate nowrap> (追記ここまで)"the message as-is, with parameter substitution but without any parsing"(追記) </translate> (追記ここまで),
/* ...any extra data... */
/* (追記) <translate nowrap> (追記ここまで)...any extra data...(追記) </translate> (追記ここまで) */
}
}
}
}
Line 130: Line 139:
</div>
</div>


The extra data in the output above is spliced into the object instead of being under the <code>data</code> key.
(追記) <translate> (追記ここまで)The extra data in the output above is spliced into the object instead of being under the (追記) <tvar name=1> (追記ここまで)<code>data</code(追記) ></tvar (追記ここまで)> key.(追記) </translate> (追記ここまで)


<translate>
=== Error messages in documentation===
=== Error messages in documentation===
</translate>
Error messages are documented in this wiki as shown below, which corresponds to the json error response in [[#Legacy format]] above:
(追記) <translate> (追記ここまで)Error messages are documented in this wiki as shown below, which corresponds to the json error response in [[(追記) <tvar name=1>#Legacy format</tvar>| (追記ここまで)#Legacy format]] above:(追記) </translate> (追記ここまで)
{| class="wikitable"
{| class="wikitable"
! Code !! Info
! (追記) <translate> (追記ここまで)Code(追記) </translate> (追記ここまで) !! (追記) <translate> (追記ここまで)Info(追記) </translate> (追記ここまで)
|-
|-
| errorcode || error message
| (追記) <translate> (追記ここまで)errorcode(追記) </translate> (追記ここまで) || (追記) <translate> (追記ここまで)error message(追記) </translate> (追記ここまで)
|}
|}


The various error messages are:
(追記) <translate> (追記ここまで)The various error messages are:(追記) </translate> (追記ここまで)
{| class="wikitable"
{| class="wikitable"
!rowspan=2| Type !!rowspan=2|Description !!colspan=2|Error message(s)
!rowspan=2| (追記) <translate> (追記ここまで)Type(追記) </translate> (追記ここまで) !!rowspan=2|(追記) <translate> (追記ここまで)Description(追記) </translate> (追記ここまで) !!colspan=2|(追記) <translate> (追記ここまで)Error message(s)(追記) </translate> (追記ここまで)
|-
|-
!Code !!Info
!(追記) <translate> (追記ここまで)Code(追記) </translate> (追記ここまで) !!(追記) <translate> (追記ここまで)Info(追記) </translate> (追記ここまで)
|-
|-
|Disabled module || The action module has been [[API:Restricting_API_usage#Disabling_modules|disabled]] in the wiki. To check if a module is available before invoking it, see [[API:FAQ#How do I|How do I check if an API module is available?]] in the FAQ. || moduledisabled || The ''modulename'' module has been disabled.
|(追記) <translate> (追記ここまで)Disabled module(追記) </translate> (追記ここまで) || The action module has been [[API:Restricting_API_usage#Disabling_modules|disabled]] in the wiki. To check if a module is available before invoking it, see [[API:FAQ#How do I|How do I check if an API module is available?]] in the FAQ. || moduledisabled || The ''modulename'' module has been disabled.
|-
|-
|Missing module || The action module is not present in the wiki, for example if it is implemented by an extension that isn't loaded || unknown_action || Unrecognized value for parameter ''action'': ''modulename''.
|(追記) <translate> (追記ここまで)Missing module(追記) </translate> (追記ここまで) || The action module is not present in the wiki, for example if it is implemented by an extension that isn't loaded || unknown_action || Unrecognized value for parameter ''action'': ''modulename''.
|-
|-
|rowspan=10|Parameter validation ||rowspan=10| Errors thrown when validating parameters of any API module. ''paramname'' is replaced by the name of the parameter. || multival_''paramname'' || Only one of <nowiki>'</nowiki>''value1''<nowiki>'</nowiki>, <nowiki>'</nowiki>''value2''<nowiki>'</nowiki>, <nowiki>'</nowiki>''value3''<nowiki>'</nowiki> is allowed for parameter <nowiki>'</nowiki>''paramname''<nowiki>'</nowiki>
|rowspan=10|(追記) <translate> (追記ここまで)Parameter validation(追記) </translate> (追記ここまで) ||rowspan=10| (追記) <translate> (追記ここまで)Errors thrown when validating parameters of any API module.(追記) </translate> (追記ここまで) (追記) <translate> (追記ここまで)''paramname'' is replaced by the name of the parameter.(追記) </translate> (追記ここまで) || multival_''paramname'' || Only one of <nowiki>'</nowiki>''value1''<nowiki>'</nowiki>, <nowiki>'</nowiki>''value2''<nowiki>'</nowiki>, <nowiki>'</nowiki>''value3''<nowiki>'</nowiki> is allowed for parameter <nowiki>'</nowiki>''paramname''<nowiki>'</nowiki>
|-
|-
| unknown_''paramname'' || {{int|apierror-unrecognizedvalue|paramname|''value''}}
| unknown_''paramname'' || {{int|apierror-unrecognizedvalue|paramname|''value''}}

Revision as of 21:10, 23 October 2023

This page is part of the MediaWiki Action API documentation.
MediaWiki Action API
Basics
Authentication
Accounts and Users
Page Operations
Search
Developer Utilities
Tutorials
v · d · e

If something goes wrong in an API request, an error or a warning will be thrown (although the HTTP response will usually still be 200 OK). Warnings are thrown for non-fatal conditions such as invalid parameters, whereas errors are only thrown for fatal conditions.

Warnings

Warnings are grouped by the name of the module that caused them. Multiple warnings from the same module are separated by a newline. In the legacy error formatting mode (see below), which is the default, warnings are output in the following format:

"warnings":{
"modulename":{
"*":"warning text"
}
}

(* will be replaced by warnings when formatversion=2 is used.)

When a non-legacy error formatting option is used, warnings are output in the same format as errors. E.g. with errorformat=wikitext the format will be:

"warnings":[
{
"code":"warning message key",
"*":"text of warning",
"module":"API module which caused the warning"
}
]

(* will be replaced with text when formatversion=2 is used.)

Warning messages

Type Description Warning message(s)
Disabled submodule The action=query submodule has been disabled in the wiki. To check if a module is available before invoking it, see How do I check if an API module is available? in the FAQ. The submodulename module has been disabled.
Missing submodule The list, prop or meta submodule is not present in the wiki, for example if it is implemented by an extension that isn't loaded. Unrecognized value for parameter list=submodule.
Parameter validation Warnings thrown when validating parameters of any API module. paramname is replaced by the name of the parameter.
  • Too many values supplied for parameter paramname: the limit is limit.
  • Unrecognized value for parameter paramname: value.
  • Unrecognized values for parameter paramname: value1, value2, value3

Errors

Error formats

Since MediaWiki 1.29 errors are localizable, and available in multiple formats. An error (or warning) is expected to consist of a message, an error code (an arbitrary string, usually generated from the message key; see also #Standard error messages below), and optional extra data (an associative array). An API response with errors will look like this:

{
"errors":[
{
"code":"error-code",
/* ...error message..., */
"data":[/* ...any extra data... */],
"module":"path to the API module that generated the error"
},
/* ...more errors... */
],
"docref":"human-readable message on where to find help"
}

The data key in the output above will be missing if there is no extra data to display.

The way the error message in the output above is returned to the client is controlled by the errorformat API parameter. The various error formats available are:

Format Description Output
html Intended for human display in HTML-capable clients
"html":"the message, interpreted as wikitext and parsed into HTML"
wikitext
"text":"the message as-is, with parameter substitution but without any parsing"
plaintext Intended for human display in HTML-incapable clients. Plaintext conversion is a minimal, best-effort transformation to make the message (assumed to contain wikitext) more readable: tags are removed, HTML entities are replaced, certain HTML tags are intelligently replaced with punctuation.
"text":"the message, like wikitext, but with added plaintext conversion"
raw Intended as a machine-readable format (note that the error key is more unique than the error code). Parameters can themselves be objects with key and params fields.
"key":"message key",
"params":[/* ...message parameters... */]
none No message information at all.
bc The default, for backward compatibility. There’s no point in specifying this value, use one of the non-legacy formats instead. See #Legacy format

For the formatting modes which involve message lookup (html, wikitext and plaintext) the API parameter errorlang can be used to set the language (only needed when different from the content language) and errorsuselocal to set whether the MediaWiki: namespace can be used to override default error messages.

Error codes are also returned in the MediaWiki-API-Error response HTTP header, separated by commas when there are multiple errors.

For an example error response or to test your client's error handling, visit https://en.wikipedia.org/w/api.php?action=blah&errorformat=plaintext&format=jsonfm&formatversion=2

When errorformat is not set (or set to bc), errors will be displayed in the legacy format instead.

Legacy format

In the legacy error format, there is always at most one error; additional ones are discarded. The response looks like this:

{
"error":{
"code":"error-code",
"info":"the message as-is, with parameter substitution but without any parsing",
/* ...any extra data... */
}
}

The extra data in the output above is spliced into the object instead of being under the data key.

Error messages in documentation

Error messages are documented in this wiki as shown below, which corresponds to the json error response in #Legacy format above:

Code Info
errorcode error message

The various error messages are:

Type Description Error message(s)
Code Info
Disabled module The action module has been disabled in the wiki. To check if a module is available before invoking it, see How do I check if an API module is available? in the FAQ. moduledisabled The modulename module has been disabled.
Missing module The action module is not present in the wiki, for example if it is implemented by an extension that isn't loaded unknown_action Unrecognized value for parameter action: modulename.
Parameter validation Errors thrown when validating parameters of any API module. paramname is replaced by the name of the parameter. multival_paramname Only one of 'value1', 'value2', 'value3' is allowed for parameter 'paramname'
unknown_paramname Unrecognized value for parameter paramname: value.
paramname paramname may not be less than min (set to value).
paramname paramname may not be over max (set to value) for bots or sysops.
paramname paramname may not be over max (set to value) for users.
badtimestamp_paramname Invalid value "value" for timestamp parameter paramname.
baduser_paramname Invalid value "value" for user parameter paramname.
invalidparammix The parameters param1, param2, param3 cannot be used together
missingparam One of the parameters param1, param2, param3 is required
_badcontinue Invalid continue param. You should pass the original value returned by the previous query

Standard error messages

Some generic error messages are shared among modules. If a module can throw these errors, that's explicitly mentioned in its Possible errors section.

Code Info
unknownerror Unknown error: This usually means something crazy like a rare race condition occurred. If you get this error, retry your request until it succeeds or returns a more informative error message
unknownerror Unknown error: "errorcode".
unknownerror-nocode Unknown error.
unsupportednamespace Pages in the Special namespace can't be edited
protectednamespace-interface You're not allowed to edit interface messages
protectednamespace You're not allowed to edit pages in the "namespace" namespace
customcssjsprotected You're not allowed to edit custom CSS and JavaScript pages
cascadeprotected This page is fully protected because it is included in the following pages, which are fully protected with the "cascading" option turned on:

list of cascade-protected pages

protectedpage The "right" right is required to edit this page
permissiondenied Permission denied.
confirmemail You must confirm your email address before editing pages.

Please set and validate your email address through your user preferences.

blocked You have been blocked from editing
autoblocked Your IP address has been blocked automatically, because it was used by a blocked user
ratelimited You've exceeded your rate limit. Please wait some time and try again
readonly The wiki is currently in read-only mode
badtoken Invalid token (did you remember to urlencode it?)
missingtitle The page you requested doesn't exist
mustbeposted Type of your HTTP request message must be POST
hookaborted The modification you tried to make was aborted by an extension hook
nosuchpageid There is no page with ID id
nosuchrevid There is no revision with ID id
nosuchrcid There is no change with rcid "id"
nosuchuser The user you specified doesn't exist
invalidtitle Bad title "title"
invaliduser Invalid username "username"
assertbotfailed "assert=bot" has been used, but logged in user is not a bot
assertuserfailed "assert=user" has been used, but user is not logged in
readapidenied You need read permission to use this module
noapiwrite Editing of this wiki through the API is disabled. Make sure the $wgEnableWriteAPI=true; statement is included in the wiki's LocalSettings.php file

Additional notes

  • All error and warning outputs above use format=json&formatversion=2. For formatversion=1, the field docref will be replaced by *.


AltStyle によって変換されたページ (->オリジナル) /