Click or drag to resize

MediaWikiJsonResponseParserOnApiError Method

This is preliminary documentation and is subject to change.

Called when error node presents in the API response.

Namespace: WikiClientLibrary.Client
Assembly: WikiClientLibrary (in WikiClientLibrary.dll) Version: 0.9.0-int.2+447d1d590e6726b7881f750a0a0e42908f3e417e
Syntax
protected virtual void OnApiError(
	string errorCode,
	string errorMessage,
	JsonNode errorNode,
	JsonNode responseNode,
	WikiResponseParsingContext context
)

Parameters

errorCode  String
Error code. (error.code)
errorMessage  String
Error message. (error.info)
errorNode  JsonNode
The error JSON node.
responseNode  JsonNode
The JSON root of the API response.
context  WikiResponseParsingContext
The response parsing context, used for initiating a retry.
Remarks

The default implementation for this method throws a OperationFailedException or one of its derived exceptions. The default exception mapping is as follows

errorCode valueMapped exception type
maxlagServerLagException; NeedRetry will be set to true.
permissiondenied, readapidenied, mustbeloggedinUnauthorizedOperationException
permissions (Flow)UnauthorizedOperationException
badtokenBadTokenException
unknown_actionInvalidActionException
assertuserfailed, assertbotfailedAccountAssertionFailureException
*conflictOperationConflictException
prev_revision (Flow)OperationConflictException
internal_api_error*MediaWikiRemoteExceptionothersOperationFailedException
See Also