public class

PullRequestOutOfDateException

extends EntityOutOfDateException
java.lang.Object
   ↳ java.lang.Throwable
     ↳ java.lang.Exception
       ↳ java.lang.RuntimeException
         ↳ com.atlassian.stash.exception.ServiceException
           ↳ com.atlassian.stash.exception.EntityOutOfDateException
             ↳ com.atlassian.stash.pull.PullRequestOutOfDateException

Class Overview

A specialization of EntityOutOfDateException thrown when a PullRequest's version is out-of-date.

Summary

[Expand]
Inherited Constants
From class com.atlassian.stash.exception.EntityOutOfDateException
Public Constructors
PullRequestOutOfDateException(KeyedMessage message, Throwable cause)
Constructs a PullRequestOutOfDateException with unspecified versions.
PullRequestOutOfDateException(KeyedMessage message, PullRequest pullRequest, int expectedVersion)
Constructs a PullRequestOutOfDateException, providing the current PullRequest and the version that was expected.
@Deprecated PullRequestOutOfDateException(KeyedMessage message, int expectedVersion, int currentVersion)
This constructor is deprecated. in 2.11 for removal in 3.0. If the current version is available the full PullRequest should be as well. Use PullRequestOutOfDateException(KeyedMessage, Throwable, PullRequest, int) instead.
PullRequestOutOfDateException(KeyedMessage message, Throwable cause, PullRequest pullRequest, int expectedVersion)
Constructs a PullRequestOutOfDateException, providing the current PullRequest and the version that was expected.
@Deprecated PullRequestOutOfDateException(KeyedMessage message, Throwable cause, int expectedVersion, int currentVersion)
This constructor is deprecated. in 2.11 for removal in 3.0. If the current version is available the full PullRequest should be as well. Use PullRequestOutOfDateException(KeyedMessage, Throwable, PullRequest, int) instead.
Public Methods
@Nullable PullRequest getPullRequest()
Retrieves the current state for the pull request, if it was available when the exception was thrown.
[Expand]
Inherited Methods
From class com.atlassian.stash.exception.EntityOutOfDateException
From class com.atlassian.stash.exception.ServiceException
From class java.lang.Throwable
From class java.lang.Object

Public Constructors

public PullRequestOutOfDateException (KeyedMessage message, Throwable cause)

Constructs a PullRequestOutOfDateException with unspecified 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 error
cause the triggering exception, or null if no cause is available

public PullRequestOutOfDateException (KeyedMessage message, PullRequest pullRequest, int expectedVersion)

Constructs a PullRequestOutOfDateException, providing the current PullRequest and the version that was expected.

Parameters
message a message describing the error
pullRequest the current pull request state
expectedVersion the expected pull request version, generally older (lower) than the current version

@Deprecated public PullRequestOutOfDateException (KeyedMessage message, int expectedVersion, int currentVersion)

This constructor is deprecated.
in 2.11 for removal in 3.0. If the current version is available the full PullRequest should be as well. Use PullRequestOutOfDateException(KeyedMessage, Throwable, PullRequest, int) instead.

Constructs a PullRequestOutOfDateException, providing the expected and current versions for the out-of-date pull request without providing the full PullRequest details.

Parameters
message a message describing the error
expectedVersion the expected pull request version, generally older (lower) than the current version
currentVersion the current pull request version

public PullRequestOutOfDateException (KeyedMessage message, Throwable cause, PullRequest pullRequest, int expectedVersion)

Constructs a PullRequestOutOfDateException, providing the current PullRequest and the version that was expected.

Parameters
message a message describing the error
cause the triggering exception, or null if no cause is available
pullRequest the current pull request state
expectedVersion the expected pull request version, generally older (lower) than the current version

@Deprecated public PullRequestOutOfDateException (KeyedMessage message, Throwable cause, int expectedVersion, int currentVersion)

This constructor is deprecated.
in 2.11 for removal in 3.0. If the current version is available the full PullRequest should be as well. Use PullRequestOutOfDateException(KeyedMessage, Throwable, PullRequest, int) instead.

Constructs a PullRequestOutOfDateException, providing the expected and current versions for the out-of-date pull request without providing the full PullRequest details.

Parameters
message a message describing the error
cause the triggering exception, or null if no cause is available
expectedVersion the expected pull request version, generally older (lower) than the current version
currentVersion the current pull request version

Public Methods

@Nullable public PullRequest getPullRequest ()

Retrieves the current state for the pull request, if it was available when the exception was thrown. When available, the version of the returned pull request will always match the current version.

Returns
  • the current pull request, or null if the current state was not available