Class MediaWikiApiErrorException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.wikidata.wdtk.wikibaseapi.apierrors.MediaWikiApiErrorException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AssertUserFailedException
,EditConflictErrorException
,MaxlagErrorException
,NoSuchEntityErrorException
,TagsApplyNotAllowedException
,TokenErrorException
Exception for reporting general MediaWiki API errors.
- Author:
- Markus Kroetzsch
- See Also:
-
Constructor Summary
ConstructorDescriptionMediaWikiApiErrorException
(String errorCode, String errorMessage) Creates a new exception for the given error code and message. -
Method Summary
Modifier and TypeMethodDescriptionReturns the MediaWiki code of the error that has causes this exception.Returns the MediaWiki message string for the error that has causes this exception.Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
MediaWikiApiErrorException
Creates a new exception for the given error code and message.- Parameters:
errorCode
- MediaWiki reported error codeerrorMessage
- MediaWiki reported error message, or any other human-readable message string generated locally
-
-
Method Details
-
getErrorCode
Returns the MediaWiki code of the error that has causes this exception.- Returns:
- error code
-
getErrorMessage
Returns the MediaWiki message string for the error that has causes this exception. Note that this is only part of the exception message obtained byThrowable.getMessage()
.- Returns:
- error message
-