Skip to content

Commit e858124

Browse files
Berkmann18jakebolam
authored andcommitted
fix: changed error.code to error.status (#54) (#55)
Due to deprecation warnings, I changed the `code` attribute to `status` to fix [ac-bot#54](#54).
1 parent a9b9028 commit e858124

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/Repository/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Repository {
2121
path: filePath,
2222
})
2323
} catch (error) {
24-
if (error.code === 404) {
24+
if (error.status === 404) {
2525
throw new ResourceNotFoundError(filePath, this.full_name)
2626
} else {
2727
throw error

src/utils/getUserDetails.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ async function getUserDetials({ github, username }) {
1515
try {
1616
result = await github.users.getByUsername({ username })
1717
} catch (error) {
18-
if (error.code === 404) {
18+
if (error.status === 404) {
1919
throw new UserNotFoundError(username)
2020
} else {
2121
throw error

0 commit comments

Comments
 (0)