Skip to content

Commit

Permalink
new xo convention: catch (error) {}
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgovea committed Feb 14, 2019
1 parent 20b5b39 commit fe70c2a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,8 @@ class Frisbee {
) {
try {
opts.body = JSON.stringify(opts.body);
} catch (err) {
throw err;
} catch (error) {
throw error;
}
}
}
Expand Down Expand Up @@ -201,7 +201,7 @@ class Frisbee {
if (res.body.error.param)
res.err.param = res.body.error.param;
}
} catch (e) {
} catch (error) {
res.err = this.parseErr;
}
}
Expand All @@ -222,7 +222,7 @@ class Frisbee {
res.body = await res.text();
res.body = JSON.parse(res.body);
}
} catch (err) {
} catch (error) {
if (contentType === 'application/json') {
res.err = this.parseErr;
resolve(res);
Expand All @@ -234,8 +234,8 @@ class Frisbee {
}

resolve(res);
} catch (err) {
reject(err);
} catch (error) {
reject(error);
}
});
};
Expand Down
4 changes: 2 additions & 2 deletions test/browser.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ test('should create Frisbee instance with all methods', t => {
const res = await api[method]('/', {});
t.true(_.isObject(res));
t.true(_.isObject(res.body));
} catch (err) {
throw err;
} catch (error) {
throw error;
}
});
});
8 changes: 4 additions & 4 deletions test/node.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ standardMethods.forEach(method => {
const res = await api[method]('/', opts);
t.true(_.isObject(res));
t.true(_.isObject(res.body));
} catch (err) {
throw err;
} catch (error) {
throw error;
}
});
});
Expand Down Expand Up @@ -252,8 +252,8 @@ methods.forEach(method => {
try {
await api[method]('/');
t.true(interceptor.request.calledOnce);
} catch (err) {
throw err;
} catch (error) {
throw error;
}
});
});
Expand Down

0 comments on commit fe70c2a

Please sign in to comment.