Delen via


MultiShardException Class

  • java.lang.Object
    • Exception
      • com.microsoft.azure.elasticdb.query.exception.MultiShardException

public class MultiShardException

DEVNOTE: Encapsulate SMM ShardLocation type for now since Shard isn't Serializable Support for serialization of ShardLocation is in the works. A MultiShardException represents an exception that occurred when performing operations against a shard. It provides information about both the identity of the shard and the exception that occurred. Depending on the nature of the exception, one can try re-running the multi-shard query, execute a separate query targeted directly at the shard(s) on that yielded the exception, or lastly execute the query manually against the shard using a common tool such as SSMS.

Constructor Summary

Constructor Description
MultiShardException()

Initializes a new instance of the MultiShardException class.

MultiShardException(ShardLocation shardLocation)

Initializes a new instance of the MultiShardException class with the specified shard location.

MultiShardException(ShardLocation shardLocation, Exception inner)

Initializes a new instance of the MultiShardException class with the specified shard location and exception.

MultiShardException(ShardLocation shardLocation, String message)

Initializes a new instance of the MultiShardException class with the specified shard location and error message.

MultiShardException(ShardLocation shardLocation, String message, Exception inner)

Initializes a new instance of the MultiShardException class with the specified shard location, error message and exception encountered.

MultiShardException(String message)

Initializes a new instance of the MultiShardException class with the specified error message.

MultiShardException(String message, Exception innerException)

Initializes a new instance of the MultiShardException class with the specified error message and the reference to the inner exception that is the cause of this exception.

Method Summary

Modifier and Type Method and Description
final ShardLocation getShardLocation()

The shard associated with this exception.

String toString()

Creates and returns a string representation of the current MultiShardException.

Constructor Details

MultiShardException

public MultiShardException()

Initializes a new instance of the MultiShardException class.

MultiShardException

public MultiShardException(ShardLocation shardLocation)

Initializes a new instance of the MultiShardException class with the specified shard location.

Parameters:

shardLocation - specifies the location of the shard where the exception occurred.

MultiShardException

public MultiShardException(ShardLocation shardLocation, Exception inner)

Initializes a new instance of the MultiShardException class with the specified shard location and exception.

Parameters:

shardLocation - specifies the location of the shard where the exception occurred.
inner - specifies the exception encountered at the shard.

MultiShardException

public MultiShardException(ShardLocation shardLocation, String message)

Initializes a new instance of the MultiShardException class with the specified shard location and error message.

Parameters:

shardLocation - specifies the location of the shard where the exception occurred.
message - specifies the message that explains the reason for the exception.

MultiShardException

public MultiShardException(ShardLocation shardLocation, String message, Exception inner)

Initializes a new instance of the MultiShardException class with the specified shard location, error message and exception encountered.

Parameters:

shardLocation - specifies the location of the shard where the exception occurred.
message - specifies the message that explains the reason for the exception.
inner - specifies the exception encountered at the shard.

Throws:

IllegalArgumentException - The shardLocation is null

MultiShardException

public MultiShardException(String message)

Initializes a new instance of the MultiShardException class with the specified error message.

Parameters:

message - specifies the exception encountered at the shard.

MultiShardException

public MultiShardException(String message, Exception innerException)

Initializes a new instance of the MultiShardException class with the specified error message and the reference to the inner exception that is the cause of this exception.

Parameters:

message - specifies the message that explains the reason for the exception.
innerException - specifies the exception encountered at the shard.

Method Details

getShardLocation

public final ShardLocation getShardLocation()

The shard associated with this exception.

toString

public String toString()

Creates and returns a string representation of the current MultiShardException.

Returns:

String representation of the current exception.

Applies to