LargeFileUploadTask not using GraphError

Abierto
#1,557 1 comentario 1 reacción 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
3/5
Tiempo estimado
1-2 días
Aptitud para principiantes
45/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
typescript
Área
api

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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

Lenguaje dominante
TypeScript
Estrellas
833
Forks
240
Métricas de merge de PR
Sin PR fusionados en 30 d

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de microsoftgraph/msgraph-sdk-javascript

Todos los issues de microsoftgraph/msgraph-sdk-javascript

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.