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

public class MediaWikiApiErrorException extends Exception
Exception for reporting general MediaWiki API errors.
Author:
Markus Kroetzsch
See Also:
  • Constructor Details

    • MediaWikiApiErrorException

      public MediaWikiApiErrorException(String errorCode, String errorMessage)
      Creates a new exception for the given error code and message.
      Parameters:
      errorCode - MediaWiki reported error code
      errorMessage - MediaWiki reported error message, or any other human-readable message string generated locally
  • Method Details

    • getErrorCode

      public String getErrorCode()
      Returns the MediaWiki code of the error that has causes this exception.
      Returns:
      error code
    • getErrorMessage

      public String 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 by Throwable.getMessage().
      Returns:
      error message