Closed Rohland closed 2 years ago
Came to write the same issue. The parse is indeed failing, however the catch block does not return, and the function goes on to treat it as a valid object. I believe return Core.throwError(..
is possibly the expected behavior.
This has been addressed in v2.4.1.
This evening on 15 December 2021, Chargebee is down throwing a 503.
Response is:
Despite error handling in place, our services are crashing because of a bug in processing responses in core.ts. See below:
https://github.com/chargebee/chargebee-typescript/blob/d0a0bc6173c996d654ec2dee7914b077d622104b/src/core.ts#L25-L33
Error thrown is:
It looks like the response is a valid JSON string and is being parsed appropriately, however, an assumption has been made that the result is an object which can be extended.
An appropriate type check is required to validate the response type is indeed an object.