We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ec65a3a + 3a0927b commit e4deb5cCopy full SHA for e4deb5c
lib/AvaTaxClient.js
@@ -93,7 +93,15 @@ export default class AvaTaxClient {
93
}
94
return res.text();
95
}).then(text => {
96
- var json = JSONbig.parse(text);
+ var json;
97
+ try {
98
+ json = JSONbig.parse(text);
99
+ } catch (e) {
100
+ let ex = new Error('The response is in an unexpected format. See details for the complete response.');
101
+ ex.target = 'Unknown';
102
+ ex.details = text;
103
+ throw ex;
104
+ }
105
// handle error
106
if (json.error) {
107
let ex = new Error(json.error.message);
0 commit comments