Azure / Azure/Azurite

The error message of error "LeaseNotPresentWithBlobOperation" in azurite is inconsistent with the one in azure cloud

Open
#635 3 comments 0 reactions 1 assignee Claimed by @blueww View on GitHub
alignment blob-storage NewArch stale
Dominant language
TypeScript
Stars
2.3k
Forks
393
Avg merge
1d 20h
Merged PRs (30d)
36

Description

**Error Description:**
The error message of error "LeaseNotPresentWithBlobOperation" in azurite is inconsistent with the one in azure cloud.
In azure, the error is shown as following:
![Screenshot 2020-11-19 154519](https://user-images.githubusercontent.com/20970631/100209481-e919dd00-2f44-11eb-8529-81d8945f5662.png)
In azurite, the error is shown as following:
![Screenshot 2020-11-19 154619](https://user-images.githubusercontent.com/20970631/100209627-136b9a80-2f45-11eb-914c-857bb5768ce8.png)

**To Reproduce**
Please run the demo code as following:
```
import {
BlobServiceClient
} from "@azure/storage-blob";
import * as assert from "assert"

async function main() {
const blobServiceClient = await BlobServiceClient.fromConnectionString("");
const containerClient = await blobServiceClient.getContainerClient("");
const blockBlobClient = await containerClient.getBlockBlobClient("");
try{
await blockBlobClient.commitBlockList(new Array(),{conditions:{leaseId:}});
}catch(err){
console.log(err);
assert.ok((err as any).response.parsedBody.message.includes("There is currently no lease on the blob"));
}
}

main();
```

**Error Track**
The reason maybe is that the error message of error "LeaseNotPresentWithBlobOperation" which is defined in Azurite is different from the one in Azure. The error "LeaseNotPresentWithBlobOperation" defined in Azurite is shown as following:
[https://github.com/Azure/Azurite/blob/master/src/blob/errors/StorageErrorFactory.ts#L390](https://github.com/Azure/Azurite/blob/master/src/blob/errors/StorageErrorFactory.ts#L390)
![Screenshot 2020-11-18 173049](https://user-images.githubusercontent.com/20970631/99511956-e444ae80-29c3-11eb-92b1-dd0162e933ea.png)

**Expected Behavior**
The error message of error "LeaseNotPresentWithBlobOperation" in azurite is consistent with the one in azure cloud.

@jongio for notification.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.