fix: throw errors on request failure
This commit is contained in:
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)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user