Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check text on bad request status #290

Merged
merged 1 commit into from Apr 1, 2019
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

@@ -81,10 +81,18 @@ RequestUtil.prototype.refreshAWSCredentials = function () {
}
return window.fetch(url, params)
.then((response) => {
if (!response.ok) {
if (response.ok) {
return response.arrayBuffer()
}
if (response.status === 400) {
// Bad request
return response.text().then((text) => {
// See server/lib/request-verifier.js for error strings
throw new Error(`Credential server response 400. ${text}`)
})
} else {
throw new Error(`Credential server response ${response.status}`)
}
return response.arrayBuffer()
})
.then((buffer) => {
console.log('Refreshed credentials.')
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.