Azure / Azure/Azurite

The error returned in Azurite is inconsistent with the one in Azure when use unauthorized queueClient to perform operation

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

Description

**Error Description:**
The error returned in Azurite is inconsistent with the one in Azure when use unauthorized queueClient to perform operation.
In Azure, the error is shown as following:
![Screenshot 2020-12-15 141905](https://user-images.githubusercontent.com/20970631/102178510-816e0680-3ee0-11eb-8046-0304c115822b.png)
In Azurite, the error is shown as following:
![Screenshot 2020-12-15 113027](https://user-images.githubusercontent.com/20970631/102178537-8e8af580-3ee0-11eb-8abc-c05fbe5c93c8.png)
Note: Azurite doesn't define error `ResourceNotFound`.

**To Reproduce**
The demo code is shown as following:
```
import { QueueClient,StorageSharedKeyCredential, QueueServiceClient } from "@azure/storage-queue"
import * as assert from "assert"

async function main(){
const queueServiceClient = new QueueServiceClient("",new StorageSharedKeyCredential("",""));
const queueClient = queueServiceClient.getQueueClient("");
const unauthorizedQueueClient = new QueueClient(queueClient.url);
await unauthorizedQueueClient.create();
}

main().catch((err)=>{
assert.ok((err as any).response.parsedBody.Code === "ResourceNotFound");
});
```

**Expected Behavior**
The error returned in Azurite is consistent with the one in Azure when use unauthorized queueClient to perform operation.

@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.