Skip to content

Commit

Permalink
Remove unnecessary try/catch
Browse files Browse the repository at this point in the history
  • Loading branch information
James M. Greene authored and James M. Greene committed Sep 17, 2022
1 parent 25a1ec8 commit 1cefe6f
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions src/api-client.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,17 @@ async function enablePagesSite({ repositoryNwo, githubToken }) {
}

async function getPagesSite({ repositoryNwo, githubToken }) {
try {
const pagesEndpoint = `${getApiBaseUrl()}/repos/${repositoryNwo}/pages`
const pagesEndpoint = `${getApiBaseUrl()}/repos/${repositoryNwo}/pages`

const response = await axios.get(pagesEndpoint, {
headers: {
Accept: 'application/vnd.github.v3+json',
Authorization: `Bearer ${githubToken}`
}
})
const response = await axios.get(pagesEndpoint, {
headers: {
Accept: 'application/vnd.github.v3+json',
Authorization: `Bearer ${githubToken}`
}
})

const pageObject = response.data
return pageObject
} catch (error) {
throw error
}
const pageObject = response.data
return pageObject
}

async function findOrCreatePagesSite({ repositoryNwo, githubToken, enablement = true }) {
Expand Down

0 comments on commit 1cefe6f

Please sign in to comment.