Skip to content

Commit

Permalink
fix: changed error.code to error.status (#54) (#55)
Browse files Browse the repository at this point in the history
Due to deprecation warnings, I changed the `code` attribute to `status`
to fix
[ac-bot#54](all-contributors/app#54).
  • Loading branch information
Berkmann18 authored and jakebolam committed Jan 19, 2019
1 parent a9b9028 commit e858124
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Repository/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Repository {
path: filePath,
})
} catch (error) {
if (error.code === 404) {
if (error.status === 404) {
throw new ResourceNotFoundError(filePath, this.full_name)
} else {
throw error
Expand Down
2 changes: 1 addition & 1 deletion src/utils/getUserDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ async function getUserDetials({ github, username }) {
try {
result = await github.users.getByUsername({ username })
} catch (error) {
if (error.code === 404) {
if (error.status === 404) {
throw new UserNotFoundError(username)
} else {
throw error
Expand Down

0 comments on commit e858124

Please sign in to comment.