diff --git a/index.js b/index.js index a7f0f50..f6101ce 100644 --- a/index.js +++ b/index.js @@ -101,9 +101,6 @@ module.exports = (() => { getFileContents(file = missingParameter()) { return this.get(file) .then(data => this.decode(data.content)) - .catch(err => { - throw err - }) } /** @@ -114,9 +111,6 @@ module.exports = (() => { const uri = `${API_URL}/repositories` return this.axios.get(uri) .then(response => response.data) - .catch(err => { - throw err - }) } /** @@ -129,9 +123,6 @@ module.exports = (() => { const uri = `${API_URL}/repos/${owner}/${repo}` return this.axios.get(uri) .then(response => response.data) - .catch(err => { - throw err - }) } /** diff --git a/test/test_basic.js b/test/test_basic.js index 349f989..7681290 100644 --- a/test/test_basic.js +++ b/test/test_basic.js @@ -173,4 +173,20 @@ describe("# valid-api-errors", function() { } }) + it ("Try to getRepo() with a bad path provided", () => { + let a = new api({token: GPG_KEY, username: "jeff", pw: "secret"}) + a.getRepo('fake.md', 'fake') + .catch(err => { + assert(err) + }) + }) + + it ("Try to listRepos() for a bad username", () => { + let a = new api({username: "jeff", pw: "secret"}) + a.listRepos() + .catch(err => { + assert(err) + }) + }) + })