Package com.atlassian.bitbucket.pull
Class PullRequestOutOfDateException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.atlassian.bitbucket.ServiceException
com.atlassian.bitbucket.EntityOutOfDateException
com.atlassian.bitbucket.pull.PullRequestOutOfDateException
- All Implemented Interfaces:
Serializable
- See Also:
-
Field Summary
Fields inherited from class com.atlassian.bitbucket.EntityOutOfDateException
UNKNOWN_VERSION
-
Constructor Summary
ConstructorDescriptionPullRequestOutOfDateException
(KeyedMessage message, PullRequest pullRequest, int expectedVersion) Constructs aPullRequestOutOfDateException
, providing the currentPullRequest
and the version that wasexpected
.PullRequestOutOfDateException
(KeyedMessage message, Throwable cause) Constructs aPullRequestOutOfDateException
withunspecified
versions.PullRequestOutOfDateException
(KeyedMessage message, Throwable cause, PullRequest pullRequest, int expectedVersion) Constructs aPullRequestOutOfDateException
, providing the currentPullRequest
and the version that wasexpected
. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the current state for the pull request, if it was available when the exception was thrown.Methods inherited from class com.atlassian.bitbucket.EntityOutOfDateException
getCurrentVersion, getExpectedVersion
Methods inherited from class com.atlassian.bitbucket.ServiceException
getKeyedMessage, getLocalizedMessage, getMessageKey
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
PullRequestOutOfDateException
Constructs aPullRequestOutOfDateException
withunspecified
versions. Because this constructor provides so little information, it should be avoided except in situaitons where there is simply no additional information available.- Parameters:
message
- a message describing the errorcause
- the triggering exception, ornull
if no cause is available
-
PullRequestOutOfDateException
public PullRequestOutOfDateException(@Nonnull KeyedMessage message, @Nonnull PullRequest pullRequest, int expectedVersion) Constructs aPullRequestOutOfDateException
, providing the currentPullRequest
and the version that wasexpected
.- Parameters:
message
- a message describing the errorpullRequest
- the current pull request stateexpectedVersion
- the expected pull request version, generally older (lower) than the current version
-
PullRequestOutOfDateException
public PullRequestOutOfDateException(@Nonnull KeyedMessage message, @Nullable Throwable cause, @Nonnull PullRequest pullRequest, int expectedVersion) Constructs aPullRequestOutOfDateException
, providing the currentPullRequest
and the version that wasexpected
.- Parameters:
message
- a message describing the errorcause
- the triggering exception, ornull
if no cause is availablepullRequest
- the current pull request stateexpectedVersion
- the expected pull request version, generally older (lower) than the current version
-
-
Method Details
-
getPullRequest
Retrieves the current state for the pull request, if it was available when the exception was thrown. When available, theversion
of the returned pull request will always match thecurrent version
.- Returns:
- the current pull request, or
null
if the current state was not available
-