Class MaxlagErrorException
java.lang.Object
java.lang.Throwable
java.lang.Exception
org.wikidata.wdtk.wikibaseapi.apierrors.MediaWikiApiErrorException
org.wikidata.wdtk.wikibaseapi.apierrors.MaxlagErrorException
- All Implemented Interfaces:
Serializable
Exception to indicate a MediaWiki API error caused by exceeding the maxlag
parameter. See MediaWiki
documentation.
- Author:
- Markus Kroetzsch
- See Also:
-
Field Summary
-
Constructor Summary
ConstructorDescriptionMaxlagErrorException
(String errorMessage) Creates a new exception.MaxlagErrorException
(String errorMessage, double lag) Creates an exception which also stores the lag announced by the server. -
Method Summary
Modifier and TypeMethodDescriptiondouble
getLag()
Retrieves the amount of lag announced by the server when this error was emitted.Methods inherited from class org.wikidata.wdtk.wikibaseapi.apierrors.MediaWikiApiErrorException
getErrorCode, getErrorMessage
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
lag
protected double lag
-
-
Constructor Details
-
MaxlagErrorException
Creates a new exception.- Parameters:
errorMessage
- the error message reported by MediaWiki, or any other meaningful message for the user
-
MaxlagErrorException
Creates an exception which also stores the lag announced by the server.- Parameters:
errorMessage
- the error message reported by MediaWiki, or any other meaningful message for the userlag
- the value of the reported lag, in seconds
-
-
Method Details
-
getLag
public double getLag()Retrieves the amount of lag announced by the server when this error was emitted. May return 0 if the lag was not extracted from the server response.- Returns:
- the lag on the target server
-