如何捕获天蓝色的节流异常? [英] how to capture throttling exceptions for azure?

查看:52
本文介绍了如何捕获天蓝色的节流异常?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下代码将blob上传到Azure:

var cloudStorageAccount = await GetCloudStorageAccount(connectionString);
var blobClient = cloudStorageAccount.CreateCloudBlobClient();
var containerRef = blobClient.GetContainerReference(containerName);
var blobRef = containerRef.GetBlockBlobReference(fileName);
await blobRef.UploadTextAsync(fileContent);

I need to add code which captures throttling exceptions. For example, if my code above is being called in a loop and the number of attempted writes exceeds the configured limit in Azure, then some type of 429 (Too Many Requests) error will be thrown. How can I catch that exception? Is there any time of special error class for that like AzureThrottleException? Or can you recommend another way of handling this exception state?

推荐答案

请参阅https://stackoverflow.com/questions/44595226 /azure-storage-response-code-for-429

Pls refer to https://stackoverflow.com/questions/44595226/azure-storage-response-code-for-429

hth
Marcin

hth
Marcin


这篇关于如何捕获天蓝色的节流异常?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆