Skip to content

Commit

Permalink
fix(SmartcarErrorV2): use request.uri to determine version (#126)
Browse files Browse the repository at this point in the history
`options.uri` does not contain any portions of the uri that are in the `baseUrl`
  • Loading branch information
gurpreetatwal authored Apr 24, 2021
1 parent 25790fc commit ad46f07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ util.catch = function(caught) {
const options = caught.options;
const body = _.get(caught, 'response.body', {});

if (options.uri.includes('/v2.0/')) {
if (caught.response.request.uri.href.includes('/v2.0/')) {
throw new errors.SmartcarErrorV2(body);
}

Expand Down

0 comments on commit ad46f07

Please sign in to comment.