@azure/storage-blob 12.9.0-beta.3 → 12.9.1-alpha.20220311.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -13,7 +13,7 @@ import { rangeToString } from "./Range";
13
13
  import { StorageClient } from "./StorageClient";
14
14
  import { Batch } from "./utils/Batch";
15
15
  import { BufferScheduler } from "../../storage-common/src";
16
- import { BLOCK_BLOB_MAX_BLOCKS, BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES, BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES, DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES, DEFAULT_BLOCK_BUFFER_SIZE_BYTES, DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS, ETagAny, URLConstants, } from "./utils/constants";
16
+ import { BlobUsesCustomerSpecifiedEncryptionMsg, BLOCK_BLOB_MAX_BLOCKS, BLOCK_BLOB_MAX_STAGE_BLOCK_BYTES, BLOCK_BLOB_MAX_UPLOAD_BLOB_BYTES, DEFAULT_BLOB_DOWNLOAD_BLOCK_BYTES, DEFAULT_BLOCK_BUFFER_SIZE_BYTES, DEFAULT_MAX_DOWNLOAD_RETRY_REQUESTS, ETagAny, URLConstants, } from "./utils/constants";
17
17
  import { createSpan, convertTracingToRequestOptionsBase } from "./utils/tracing";
18
18
  import { appendToURLPath, appendToURLQuery, extractConnectionStringParts, generateBlockID, getURLParameter, httpAuthorizationToString, isIpEndpointStyle, parseObjectReplicationRecord, setURLParameter, toBlobTags, toBlobTagsString, toQuerySerialization, toTags, } from "./utils/utils.common";
19
19
  import { fsCreateReadStream, fsStat, readStreamToLocalFile, streamToBuffer, } from "./utils/utils.node";
@@ -301,12 +301,14 @@ export class BlobClient extends StorageClient {
301
301
  }
302
302
  catch (e) {
303
303
  if (e.statusCode === 404) {
304
- span.setStatus({
305
- code: SpanStatusCode.ERROR,
306
- message: "Expected exception when checking blob existence",
307
- });
304
+ // Expected exception when checking blob existence
308
305
  return false;
309
306
  }
307
+ else if (e.statusCode === 409 &&
308
+ e.details.errorCode === BlobUsesCustomerSpecifiedEncryptionMsg) {
309
+ // Expected exception when checking blob existence
310
+ return true;
311
+ }
310
312
  span.setStatus({
311
313
  code: SpanStatusCode.ERROR,
312
314
  message: e.message,