mirror of
https://github.com/peter-evans/dockerhub-description.git
synced 2024-11-22 12:09:33 +01:00
fix: throw errors on request failure
This commit is contained in:
parent
dac62d382a
commit
8dd2813668
2 changed files with 8 additions and 0 deletions
4
dist/index.js
vendored
4
dist/index.js
vendored
|
@ -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);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue