Tabnine Logo
StorageExtendedErrorInformation.getErrorMessage
Code IndexAdd Tabnine to your IDE (free)

How to use
getErrorMessage
method
in
com.microsoft.azure.storage.StorageExtendedErrorInformation

Best Java code snippets using com.microsoft.azure.storage.StorageExtendedErrorInformation.getErrorMessage (Showing top 20 results out of 315)

origin: apache/incubator-druid

@Override
public void kill(DataSegment segment) throws SegmentLoadingException
{
 log.info("Killing segment [%s]", segment);
 Map<String, Object> loadSpec = segment.getLoadSpec();
 final String containerName = MapUtils.getString(loadSpec, "containerName");
 final String blobPath = MapUtils.getString(loadSpec, "blobPath");
 final String dirPath = Paths.get(blobPath).getParent().toString();
 try {
  azureStorage.emptyCloudBlobDirectory(containerName, dirPath);
 }
 catch (StorageException e) {
  Object extendedInfo =
    e.getExtendedErrorInformation() == null ? null : e.getExtendedErrorInformation().getErrorMessage();
  throw new SegmentLoadingException(e, "Couldn't kill segment[%s]: [%s]", segment.getId(), extendedInfo);
 }
 catch (URISyntaxException e) {
  throw new SegmentLoadingException(e, "Couldn't kill segment[%s]: [%s]", segment.getId(), e.getReason());
 }
}
origin: com.microsoft.azure/azure-storage

if (extendedError != null) {
  bld.append(", ExtendedErrorInformation= {ErrorMessage= ");
  bld.append(extendedError.getErrorMessage());
origin: Azure/azure-storage-android

private static void assertMessagesMatch(String expectedMessage, StorageException ex) {
  final String message = ex.getExtendedErrorInformation().getErrorMessage().split("\n")[0];
  assertEquals(expectedMessage, message);
}
origin: Azure/azure-event-hubs-java

private boolean wasLeaseLost(StorageException se, String partitionId) {
  boolean retval = false;
  TRACE_LOGGER.debug(this.hostContext.withHostAndPartition(partitionId, "WAS LEASE LOST? Http " + se.getHttpStatusCode()));
  if (se.getExtendedErrorInformation() != null) {
    TRACE_LOGGER.debug(this.hostContext.withHostAndPartition(partitionId,
        "Http " + se.getExtendedErrorInformation().getErrorCode() + " :: " + se.getExtendedErrorInformation().getErrorMessage()));
  }
  if ((se.getHttpStatusCode() == 409) || // conflict
      (se.getHttpStatusCode() == 412)) // precondition failed
  {
    StorageExtendedErrorInformation extendedErrorInfo = se.getExtendedErrorInformation();
    if (extendedErrorInfo != null) {
      String errorCode = extendedErrorInfo.getErrorCode();
      TRACE_LOGGER.debug(this.hostContext.withHostAndPartition(partitionId, "Error code: " + errorCode));
      TRACE_LOGGER.debug(this.hostContext.withHostAndPartition(partitionId, "Error message: " + extendedErrorInfo.getErrorMessage()));
      if ((errorCode.compareTo(StorageErrorCodeStrings.LEASE_LOST) == 0) ||
          (errorCode.compareTo(StorageErrorCodeStrings.LEASE_ID_MISMATCH_WITH_LEASE_OPERATION) == 0) ||
          (errorCode.compareTo(StorageErrorCodeStrings.LEASE_ID_MISMATCH_WITH_BLOB_OPERATION) == 0) ||
          (errorCode.compareTo(StorageErrorCodeStrings.LEASE_ALREADY_PRESENT) == 0)) {
        retval = true;
      }
    }
  }
  return retval;
}
origin: io.druid.extensions/druid-azure-extensions

@Override
public void kill(DataSegment segment) throws SegmentLoadingException
{
 log.info("Killing segment [%s]", segment);
 Map<String, Object> loadSpec = segment.getLoadSpec();
 final String containerName = MapUtils.getString(loadSpec, "containerName");
 final String blobPath = MapUtils.getString(loadSpec, "blobPath");
 final String dirPath = Paths.get(blobPath).getParent().toString();
 try {
  azureStorage.emptyCloudBlobDirectory(containerName, dirPath);
 }
 catch(StorageException e){
  throw new SegmentLoadingException(e, "Couldn't kill segment[%s]: [%s]", segment.getIdentifier(), e.getExtendedErrorInformation() == null ? null : e.getExtendedErrorInformation().getErrorMessage());
 }
 catch (URISyntaxException e) {
  throw new SegmentLoadingException(e, "Couldn't kill segment[%s]: [%s]", segment.getIdentifier(), e.getReason());
 }
}
origin: Azure/azure-storage-android

@Test
public void testInsertEntityWithNumericProperty() throws StorageException {
  TableRequestOptions options = new TableRequestOptions();
  options.setTablePayloadFormat(TablePayloadFormat.Json);
  DynamicTableEntity ref = new DynamicTableEntity();
  String propName = "";
  for (int m = 0; m < 255; m++) {
    propName = propName.concat(Integer.toString(m % 9));
  }
  ref.getProperties().put(propName, new EntityProperty("test"));
  ref.setPartitionKey("jxscl_odata");
  ref.setRowKey(UUID.randomUUID().toString());
  try {
    this.table.execute(TableOperation.insert(ref), options, null);
    fail();
  } catch (TableServiceException ex) {
    assertEquals(ex.getMessage(), "Bad Request");
    assertTrue(ex.getExtendedErrorInformation().getErrorMessage().startsWith("The property name is invalid."));
    assertEquals(ex.getExtendedErrorInformation().getErrorCode(), "PropertyNameInvalid");
  }
}
origin: Azure/azure-storage-android

@Test
public void testBatchOver100Entities() throws StorageException {
  TableRequestOptions options = new TableRequestOptions();
  options.setTablePayloadFormat(TablePayloadFormat.Json);
  TableBatchOperation batch = new TableBatchOperation();
  try {
    for (int m = 0; m < 101; m++) {
      batch.insert(TableTestHelper.generateRandomEntity("jxscl_odata"));
    }
    this.table.execute(batch, options, null);
    fail("Batch with over 100 entities should fail.");
  }
  catch (TableServiceException ex) {
    assertEquals(ex.getMessage(), "Bad Request");
    String errorAfterSemiColon = ex.getExtendedErrorInformation().getErrorMessage();
    errorAfterSemiColon = errorAfterSemiColon.substring(errorAfterSemiColon.indexOf(":") + 1);
    assertTrue(errorAfterSemiColon.startsWith("The batch request operation exceeds the maximum 100 changes per change set."));
    assertEquals(ex.getErrorCode(), StorageErrorCodeStrings.INVALID_INPUT);
  }
}
origin: Azure/azure-storage-android

@Test
public void testInsertEntityWithPropertyMoreThan255chars() throws StorageException {
  TableRequestOptions options = new TableRequestOptions();
  options.setTablePayloadFormat(TablePayloadFormat.Json);
  DynamicTableEntity ref = new DynamicTableEntity();
  String propName = "";
  for (int m = 0; m < 256; m++) {
    propName = propName.concat("a");
  }
  ref.getProperties().put(propName, new EntityProperty("test"));
  ref.setPartitionKey("jxscl_odata");
  ref.setRowKey(UUID.randomUUID().toString());
  try {
    this.table.execute(TableOperation.insert(ref), options, null);
    fail();
  } catch (TableServiceException ex) {
    assertEquals(ex.getMessage(), "Bad Request");
    assertTrue(ex.getExtendedErrorInformation().getErrorMessage()
        .startsWith("The property name exceeds the maximum allowed length (255)."));
    assertEquals(ex.getExtendedErrorInformation().getErrorCode(), "PropertyNameTooLong");
  }
}
origin: Azure/azure-storage-android

@Test
public void testTableInvalidQuery() throws StorageException {
  TableRequestOptions options = new TableRequestOptions();
  options.setTablePayloadFormat(TablePayloadFormat.Json);
  TableQuery<Class1> query = TableQuery.from(Class1.class).where(
      String.format("(PartitionKey ) and (RowKey ge '%s')", "000050"));
  try {
    table.executeSegmented(query, null, options, null);
    fail();
  }
  catch (TableServiceException ex) {
    assertEquals(ex.getMessage(), "Bad Request");
    assertTrue(ex.getExtendedErrorInformation().getErrorMessage()
        .startsWith("A binary operator with incompatible types was detected. Found operand types 'Edm.String' and 'Edm.Boolean' for operator kind 'And'."));
    assertEquals(ex.getExtendedErrorInformation().getErrorCode(), "InvalidInput");
  }
}
origin: Azure/azure-storage-android

String errorAfterSemiColon = ex.getExtendedErrorInformation().getErrorMessage();
errorAfterSemiColon = errorAfterSemiColon.substring(errorAfterSemiColon.indexOf(":") + 1);
assertTrue(errorAfterSemiColon.startsWith("The property name exceeds the maximum allowed length (255)."));
origin: Azure/azure-storage-android

String errorAfterSemiColon = ex.getExtendedErrorInformation().getErrorMessage();
errorAfterSemiColon = errorAfterSemiColon.substring(errorAfterSemiColon.indexOf(":") + 1);
assertTrue(errorAfterSemiColon.startsWith("The entity is larger than the maximum allowed size (1MB)."));
origin: Azure/azure-storage-android

@Test
public void testInsertEntityOver1MB() throws StorageException {
  TableRequestOptions options = new TableRequestOptions();
  options.setTablePayloadFormat(TablePayloadFormat.Json);
  Class1 ref = new Class1();
  ref.setA("foo_A");
  ref.setB("foo_B");
  ref.setC("foo_C");
  // 1mb right here
  ref.setD(new byte[1024 * 1024]);
  ref.setPartitionKey("jxscl_odata");
  ref.setRowKey(UUID.randomUUID().toString());
  try {
    this.table.execute(TableOperation.insert(ref), options, null);
    fail();
  } catch (TableServiceException ex) {
    assertEquals(ex.getMessage(), "Bad Request");
    assertTrue(ex.getExtendedErrorInformation().getErrorMessage()
        .startsWith("The entity is larger than the maximum allowed size (1MB)."));
    assertEquals(ex.getExtendedErrorInformation().getErrorCode(), "EntityTooLarge");
  }
}
origin: Azure/azure-storage-android

@Test
public void testInsertFail() throws StorageException {
  TableRequestOptions options = new TableRequestOptions();
  options.setTablePayloadFormat(TablePayloadFormat.Json);
  Class1 ref = new Class1();
  ref.setA("foo_A");
  ref.setB("foo_B");
  ref.setC("foo_C");
  ref.setD(new byte[]{0, 1, 2});
  ref.setPartitionKey("jxscl_odata");
  ref.setRowKey(UUID.randomUUID().toString());
  TableOperation op = TableOperation.insert(ref);
  this.table.execute(op, options, null);
  try {
    this.table.execute(op, options, null);
    fail();
  } catch (TableServiceException ex) {
    assertEquals(ex.getMessage(), "Conflict");
    assertTrue(ex.getExtendedErrorInformation().getErrorMessage()
        .startsWith("The specified entity already exists"));
    assertEquals(ex.getExtendedErrorInformation().getErrorCode(), "EntityAlreadyExists");
  }
}
origin: Azure/azure-storage-android

@Test
public void testBatchInsertFail() throws StorageException {
  TableRequestOptions options = new TableRequestOptions();
  options.setTablePayloadFormat(TablePayloadFormat.Json);
  // insert entity
  Class1 ref = TableTestHelper.generateRandomEntity("jxscl_odata");
  this.table.execute(TableOperation.insert(ref), options, null);
  try {
    TableBatchOperation batch = new TableBatchOperation();
    batch.insert(ref);
    this.table.execute(batch, options, null);
    fail();
  }
  catch (TableServiceException ex) {
    assertEquals(ex.getMessage(), "Conflict");
    assertTrue(ex.getExtendedErrorInformation().getErrorMessage()
        .startsWith("The specified entity already exists"));
    assertEquals(ex.getErrorCode(), StorageErrorCodeStrings.ENTITY_ALREADY_EXISTS);
  }
}
origin: Azure/azure-storage-android

assertTrue(e.getExtendedErrorInformation().getErrorMessage()
    .startsWith("The requested URI does not represent any resource on the server."));
origin: Azure/azure-storage-android

@Test
public void testBatchMergeFail() throws StorageException {
  TableRequestOptions options = new TableRequestOptions();
  options.setTablePayloadFormat(TablePayloadFormat.Json);
  TableBatchOperation batch = new TableBatchOperation();
  addInsertBatch(batch);
  // Insert entity to merge
  Class1 baseEntity = TableTestHelper.generateRandomEntity("jxscl_odata");
  this.table.execute(TableOperation.insert(baseEntity), options, null);
  Class1 updatedEntity = TableTestHelper.generateRandomEntity("jxscl_odata");
  updatedEntity.setPartitionKey(baseEntity.getPartitionKey());
  updatedEntity.setRowKey(baseEntity.getRowKey());
  updatedEntity.setEtag(baseEntity.getEtag());
  this.table.execute(TableOperation.replace(updatedEntity), options, null);
  // add merge to fail
  addMergeToBatch(baseEntity, batch);
  try {
    this.table.execute(batch, options, null);
    fail();
  }
  catch (TableServiceException ex) {
    assertEquals(ex.getMessage(), "Precondition Failed");
    String errorAfterSemiColon = ex.getExtendedErrorInformation().getErrorMessage();
    errorAfterSemiColon = errorAfterSemiColon.substring(errorAfterSemiColon.indexOf(":") + 1);
    assertTrue(errorAfterSemiColon
        .startsWith("The update condition specified in the request was not satisfied."));
    assertEquals(ex.getErrorCode(), StorageErrorCodeStrings.UPDATE_CONDITION_NOT_SATISFIED);
  }
}
origin: Azure/azure-storage-android

} catch (TableServiceException ex) {
  assertEquals(ex.getMessage(), "Precondition Failed");
  assertTrue(ex.getExtendedErrorInformation().getErrorMessage()
      .startsWith("The update condition specified in the request was not satisfied."));
  assertEquals(ex.getExtendedErrorInformation().getErrorCode(), "UpdateConditionNotSatisfied");
} catch (TableServiceException ex) {
  assertEquals(ex.getMessage(), "Not Found");
  assertTrue(ex.getExtendedErrorInformation().getErrorMessage()
      .startsWith("The specified resource does not exist."));
  assertEquals(ex.getExtendedErrorInformation().getErrorCode(), "ResourceNotFound");
origin: Azure/azure-storage-android

@Test
public void testBatchReplaceFail() throws StorageException {
  TableRequestOptions options = new TableRequestOptions();
  options.setTablePayloadFormat(TablePayloadFormat.Json);
  TableBatchOperation batch = new TableBatchOperation();
  // Insert entity to merge
  Class1 baseEntity = TableTestHelper.generateRandomEntity("jxscl_odata");
  this.table.execute(TableOperation.insert(baseEntity), options, null);
  Class1 updatedEntity = TableTestHelper.generateRandomEntity("jxscl_odata");
  updatedEntity.setPartitionKey(baseEntity.getPartitionKey());
  updatedEntity.setRowKey(baseEntity.getRowKey());
  updatedEntity.setEtag(baseEntity.getEtag());
  this.table.execute(TableOperation.replace(updatedEntity), options, null);
  // add merge to fail
  addReplaceToBatch(baseEntity, batch);
  try {
    this.table.execute(batch);
    fail();
  }
  catch (TableServiceException ex) {
    assertEquals(ex.getMessage(), "Precondition Failed");
    assertTrue(ex.getExtendedErrorInformation().getErrorMessage()
        .startsWith("The update condition specified in the request was not satisfied."));
    assertEquals(ex.getErrorCode(), StorageErrorCodeStrings.UPDATE_CONDITION_NOT_SATISFIED);
  }
}
origin: Azure/azure-storage-android

} catch (TableServiceException ex) {
  assertEquals(ex.getMessage(), "Precondition Failed");
  assertTrue(ex.getExtendedErrorInformation().getErrorMessage()
      .startsWith("The update condition specified in the request was not satisfied."));
  assertEquals(ex.getExtendedErrorInformation().getErrorCode(), "UpdateConditionNotSatisfied");
} catch (TableServiceException ex) {
  assertEquals(ex.getMessage(), "Not Found");
  assertTrue(ex.getExtendedErrorInformation().getErrorMessage()
      .startsWith("The specified resource does not exist."));
  assertEquals(ex.getExtendedErrorInformation().getErrorCode(), "ResourceNotFound");
origin: Azure/azure-storage-android

@Test
public void testBatchDeleteFail() throws StorageException {
  TableRequestOptions options = new TableRequestOptions();
  options.setTablePayloadFormat(TablePayloadFormat.Json);
  TableBatchOperation batch = new TableBatchOperation();
  // Insert entity to delete
  Class1 baseEntity = TableTestHelper.generateRandomEntity("jxscl_odata");
  this.table.execute(TableOperation.insert(baseEntity), options, null);
  Class1 updatedEntity = TableTestHelper.generateRandomEntity("jxscl_odata");
  updatedEntity.setPartitionKey(baseEntity.getPartitionKey());
  updatedEntity.setRowKey(baseEntity.getRowKey());
  updatedEntity.setEtag(baseEntity.getEtag());
  this.table.execute(TableOperation.replace(updatedEntity), options, null);
  // add delete to fail
  batch.delete(baseEntity);
  try {
    this.table.execute(batch, options, null);
    fail();
  }
  catch (TableServiceException ex) {
    assertEquals(ex.getMessage(), "Precondition Failed");
    assertTrue(ex.getExtendedErrorInformation().getErrorMessage()
        .startsWith("The update condition specified in the request was not satisfied."));
    assertEquals(ex.getErrorCode(), StorageErrorCodeStrings.UPDATE_CONDITION_NOT_SATISFIED);
  }
}
com.microsoft.azure.storageStorageExtendedErrorInformationgetErrorMessage

Javadoc

Gets the storage service error message.

Popular methods of StorageExtendedErrorInformation

  • getErrorCode
    Gets the storage service error code.
  • <init>
    Creates an instance of the StorageExtendedErrorInformation class.
  • getAdditionalDetails
    Gets additional error details, as a java.util.HashMap object.
  • setAdditionalDetails
    RESERVED FOR INTERNAL USE. Sets additional error details.
  • setErrorCode
    RESERVED FOR INTERNAL USE. Sets the storage service error code.
  • setErrorMessage
    RESERVED FOR INTERNAL USE. Sets the storage service error message.

Popular in Java

  • Reading from database using SQL prepared statement
  • startActivity (Activity)
  • onCreateOptionsMenu (Activity)
  • scheduleAtFixedRate (Timer)
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • Vector (java.util)
    Vector is an implementation of List, backed by an array and synchronized. All optional operations in
  • JTable (javax.swing)
  • Table (org.hibernate.mapping)
    A relational table
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now