Merge pull request #23 from peter-evans/fix-error-handling
Some checks failed
Publish Docker Image / publish (push) Has been cancelled

fix: throw errors on request failure
This commit is contained in:
Peter Evans
2020-10-27 10:44:08 +09:00
committed by GitHub
2 changed files with 8 additions and 0 deletions

4
dist/index.js vendored
View File

@@ -72,6 +72,10 @@ function updateRepositoryDescription(token, repository, description, fullDescrip
'Content-Type': 'application/json',
Authorization: `JWT ${token}`
}
}).then(res => {
if (!res.ok) {
throw new Error(res.statusText);
}
});
});
}

View File

@@ -40,5 +40,9 @@ export async function updateRepositoryDescription(
'Content-Type': 'application/json',
Authorization: `JWT ${token}`
}
}).then(res => {
if (!res.ok) {
throw new Error(res.statusText)
}
})
}