Regression: Promises are rejected with non-Error objects

Abierto
#500 6 comentarios 2 reacciones 1 asignado Ver en GitHub

@SerKnight ya está trabajando en esto.

Desde el 14/4/2021.

Evaluación

Este issue todavía no se ha evaluado.

Descripción

Type: Enhancement

SDK you're using (please complete the following information):

  • 4.10.2

Describe the bug
Promises from the SDK are being rejected with non Error objects – response objects to be precise.
This is causing Bluebird to bark with the following message: Warning: a promise was rejected with a non-error
Version 3 of the SDK did not suffer this problem and was returning actual Error objects.

Can this be modified so that it the errors responses are wrapped in an actual Error object?
The response can still be passed as a property on that error object.

To Reproduce
Steps to reproduce the behavior:

  1. Generate any error with the API
  2. Catch the error
  3. Observe that it's not an error but a response object

Expected behavior
For xero-node to throw Errors, not plain objects

Lenguaje dominante
TypeScript
Estrellas
264
Forks
177
Merge medio
10 h 5 min
PR fusionados (30 d)
5

Preparar el entorno

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 XeroAPI/xero-node

Todos los issues de XeroAPI/xero-node

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.