Regression: Promises are rejected with non-Error objects

Aperta
#500 6 commenti 2 reazioni 1 assegnatario Vedi su GitHub

@SerKnight ci sta già lavorando.

Dal 14/4/2021.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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

Lingua principale
TypeScript
Stelle
264
Fork
177
Merge medio
10h 5m
PR unite (30g)
5

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di XeroAPI/xero-node

Tutte le issue di XeroAPI/xero-node

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.