lob / lob-typescript-sdk

MIT License
11 stars 7 forks source link

RequiredError appears to be meaningless #270

Open jackofsometrade opened 1 year ago

jackofsometrade commented 1 year ago

Summary

What is RequiredError? The postcards API (among others) appears to throw an axios error, but the type definition indicates it throws RequiredError and there doesn't seem to be any documentation about that.

Expected Behavior

API requests should throw a meaningful type of error in order to create reliable error handling.

Current Behavior

It is unclear what is thrown when an API request fails.

Possible Solution

Identify the thrown type and update the typedefs, or provide examples on how to handle errors, e.g. parsing response status codes.