avadev/AvaTax-REST-V2-JS-SDK

restCall error handler

awhitford opened this issue · 1 comments

This code looks invalid:

        // handle error
        if (json.error) {
          let ex = new Error(json.error.message);
          ex.code = json.error.code;
          ex.target = json.error.target;
          ex.details = json.error.details;
          throw ex;
        } else {
          return json;
        }

Specifically, code, target, and details are not properties of an Error object.

The intent here is to add additional information to the api consumer in case of an error. Are you experience any issue with this?
Thanks