Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

Chaos Handler not working as expected

未关闭
#1,297 5 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

@koros 已经在做这个了。

开始于 2023年7月21日。

评估

这个 Issue 还没有评估数据。

描述

Needs: Attention :wave:

Bug Report

Prerequisites

  • Can you reproduce the problem?
  • Are you running the latest version?
  • Are you reporting to the correct repository?
  • Did you perform a cursory search?

For more information, see the CONTRIBUTING guide.

Description

I am trying to throw some throttling errors for a graph client using js randomly with 429 status code. So I created Chaos handler and added it as a middleware for that graph request via middlewareOptions and checked it, To my surprise, it received the correct response and didn't try to throw the error.

Steps to Reproduce

  1. Initialise a graphClient using @microsoft/microsoft-graph-client
  2. Added chaos Handler something like this:
await graphClient.api(path).middlewareOptions([
          new ChaosHandlerOptions(
            ChaosStrategy.MANUAL,
            'Retry Error',
            429,
            100,
)]).get()
  1. So As the chaos percentage is 100%, I should be expecting all throtling exceptions, But it didn't happen.

Expected behavior:

I am expecting to throw error so that I can catch it and handle it accordingly.

Actual behavior:

It returns the response data from the API request.

Additional Context

Add any other context about the problem here..

Usage Information

Request ID - Value of the requestId field if you are receiving a Graph API error response

SDK Version - 3.0.5

  • Node (Check, if using Node version of SDK)

Node Version - 18.13.0

  • Browser (Check, if using Browser version of SDK)

Browser Name - [The name of Browser that you are using for SDK]

Version - [The version of the browser you are using]

主要语言
TypeScript
星标
833
派生
240
PR 合并指标
30 天内没有已合并 PR

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

microsoftgraph/msgraph-sdk-javascript 的其他 Issue

查看 microsoftgraph/msgraph-sdk-javascript 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。