diff --git a/src/Repository/index.js b/src/Repository/index.js index 7cd90f3b..31485c4c 100644 --- a/src/Repository/index.js +++ b/src/Repository/index.js @@ -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 diff --git a/src/utils/getUserDetails.js b/src/utils/getUserDetails.js index 1aec3bd4..f658200e 100644 --- a/src/utils/getUserDetails.js +++ b/src/utils/getUserDetails.js @@ -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