Regression: Promises are rejected with non-Error objects

オープン
#500 コメント 6 件 リアクション 2 件 担当者 1 名 GitHub で見る

@SerKnight がすでに取り組んでいます。

2021年4月14日 から。

評価

この issue はまだ評価されていません。

説明

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

主要言語
TypeScript
スター
264
フォーク
177
平均マージ
10時間 5分
マージ済み PR(30日)
5

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

XeroAPI/xero-node のほかの issue

XeroAPI/xero-node の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。