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

LargeFileUploadTask not using GraphError

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

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
45/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
停滞
技术栈
typescript
领域
api

调研方向

Start with LargeFileUploadTask.ts around line 260, then trace the response handling through GraphResponseHandler.ts around lines 95 and 176-179. Confirm how upload errors are propagated and ensure an API error from LargeFileUploadTask is exposed as a GraphError rather than the raw response object.

由索引模型根据 Issue 内容生成。

描述

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?

Description

Errors thrown during a LargeFileUploadTask are not wrapped with GraphError.
Please correct me if I'm wrong, but I was expecting all errors from the API to be wrapped in that class.

In our case, this happened when running multiple uploads, but I think the specific error is irrelevant.

Screenshots:
image

You can see in the screenshot that the "error object" is just the direct response from the API:
https://learn.microsoft.com/en-us/graph/errors#json-representation

Steps to Reproduce

Not sure what to add here, I think this applies to any error during an upload task. We're experiencing this when trying to send multiple emails at once, all with attachments. This causes the MailboxConcurrency error to be thrown.

Expected behavior:
Error to be an instance of GraphError.

Actual behavior:
Error is actually the response object returned by the API.

Additional Context

I've tried to track this down, but it's my first time actually browsing the SDK code.

  1. Upload task tries to handle response: https://github.com/microsoftgraph/msgraph-sdk-javascript/blob/0f8eb690d571c37d9a8df1b8564e8a46ba46829a/src/tasks/LargeFileUploadTask.ts#L260
  2. I'm assuming it's then calling GraphResponseHandler.convertResponse: https://github.com/microsoftgraph/msgraph-sdk-javascript/blob/0f8eb690d571c37d9a8df1b8564e8a46ba46829a/src/GraphResponseHandler.ts#L95
  3. Again, I'm assuming it goes on the else branch and directly throws the response from the API: https://github.com/microsoftgraph/msgraph-sdk-javascript/blob/0f8eb690d571c37d9a8df1b8564e8a46ba46829a/src/GraphResponseHandler.ts#L176-L179

Usage Information

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

SDK Version - 3.0.6

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

Node Version - 18.15.0

主要语言
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 摘要。