chargebee / chargebee-typescript

Typescript library for the Chargebee API.
https://apidocs.chargebee.com/docs/api?lang=typescript
MIT License
23 stars 16 forks source link

add configuration option to allow throwing of errors instead of objects #25

Open wodka opened 2 years ago

wodka commented 2 years ago

fixes #21

Idea is that we can configure this behaviour:

const c = new ChargeBee()

c.configure({
  site: '***',
  api_key: '***',
  useErrorObject: true
})
ibratoev commented 2 years ago

It is a bit strange having an option to throw errors instead of objects. What is the point of throwing objects at all? It is a standard JS practice of using Error for... errors.

wodka commented 2 years ago

I'm for only throwing errors!