API:Errors and warnings/ja
Quick overview:
- Quick start guide
- FAQ
- チュートリアル
- フォーマット
- エラーの報告
- 使用制限
- クロスサイト リクエスト
- 認証
- クエリ
- 検索の提案
- ウィキテキストの構文解析とテンプレートの展開
- ページのキャッシュの破棄
- パラメーター情報
- ウィキの本文の変更
- ウォッチリストのフィード
- ウィキデータ /en
- 拡張機能
- MediaWikiおよび拡張機能内でのAPIの使用
- その他
- 実装
- クライアント コード
- アサート
API モジュールが何らかの原因で失敗した場合、エラーまたは警告が出力されます (although the HTTP response will usually still be 200 OK
)。警告は、パラメーターが無効などの致命的ではない場合に、エラーは致命的な場合のみ使用されます。
Contents
警告[edit | edit source]
Warnings are output in the following format:
<?xml version="1.0" encoding="utf-8"?> <api> <warnings> <query>Warning text Another warning</query> <info>A warning from prop=info</info> </warnings> </api>
As shown in the example, warnings are grouped by the name of the module that caused them. Multiple warnings from the same module are separated by a newline.
無効化されたモジュール[edit | edit source]
Disabled action=query
submodules will always throw the following warning:
- The "modulename" module has been disabled.
パラメーター検証の警告[edit | edit source]
The following warnings can be thrown when validating parameters, and can therefore be thrown by all modules. 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
エラー[edit | edit source]
Error messages are output in the following format:
<error code="code" info="info" />
Where code
is replaced with a short error code (which need not be unique to the error) and info
with a more elaborate description of the error (which is unique). Also, the error code will be returned in the MediaWiki-API-Error
HTTP header. For an example error response or to test your client's error handling, see http://en.wikipedia.org/w/api.php?action=blah
Note that when viewing errors in pretty-print formats, the API help will be returned inside the <error>
element. To save bandwidth, this doesn't happen for non-pretty-print formats; if you specifically want the help text in a non-pretty-print format, use action=help
.
ドキュメントのエラーメッセージ[edit | edit source]
エラーメッセージは次のように文章にされます:
コード | 情報 |
---|---|
apparams | prlevel は prtype なしでは使用できません |
対応するものは次の通りです(訳注: 分かりやすくするために日本語訳):
<error code="apparams" info="prlevelはprtype無しで使うことができません" />
無効化されたモジュール[edit | edit source]
Disabled action=
modules will always fail with the following error:
コード | 情報 |
---|---|
moduledisabled | The "modulename" module has been disabled. |
パラメーター検証のエラー[edit | edit source]
The following errors can be thrown when validating parameters, and can therefore be thrown by all modules. 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 set to less than min (set to value) |
paramname | paramname may not be set over max (set to value) for bots and sysops |
paramname | paramname may not be set 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 |
標準的なエラーメッセージ[edit | edit source]
一般的なエラー メッセージの中にはモジュール間で共有されるものがあります。モジュールがこれらのエラーをスローする場合、Possible errors
セクションで明示的に言及されます。
コード | 情報 |
---|---|
unknownerror | 不明なエラー: 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 | 不明なエラー errorcode |
unsupportednamespace | Special 名前空間内のページは編集できません |
protectednamespace-interface | あなたはインターフェイス メッセージを編集することを許可されていません |
protectednamespace | 「namespace」名前空間内のページの編集することを許可されていません |
customcssjsprotected | あなたは CSS ページや JavaScript ページを編集することを許可されていません |
cascadeprotected | あなたが編集しようとしているページは、カスケード保護されたページで参照読み込みされているため、保護されています。 |
protectedpage | このページを編集するには「right」の権限が必要です |
permissiondenied | パーミッションが拒否されました |
confirmemail | You must confirm your e-mail address before you can edit |
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 | 現在、ウィキは読み取り専用モードになっています |
badtoken | 無効なトークンです (urlencode するのを忘れていませんか?) |
missingtitle | リクエストしたページは存在しません |
mustbeposted | Type of your HTTP request message must be POST |
hookaborted | The modification you tried to make was aborted by an extension hook |
nosuchpageid | ID id のページはありません |
nosuchrevid | ID id の版はありません |
nosuchrcid | There is no change with rcid "id" |
nosuchuser | 指定した利用者は存在しません |
invalidtitle | 無効なページ名「title」 |
invaliduser | 無効な利用者名「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 |