Skip to content

Commit

Permalink
Improve "Browser client is out of date" error message (elastic#50296)
Browse files Browse the repository at this point in the history
* improve "Browser client is out of date" error message

* Improve wording of error message

Co-Authored-By: Josh Dover <[email protected]>

* Fox formatting

* Fix format
  • Loading branch information
sorenlouv committed Nov 16, 2019
1 parent fbe479a commit ac3aa28
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/legacy/server/http/version_check.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ export function setupVersionCheck(server, config) {
const versionRequested = req.headers[versionHeader];

if (versionRequested && versionRequested !== actualVersion) {
throw badRequest('Browser client is out of date, please refresh the page', {
expected: actualVersion,
got: versionRequested
});
throw badRequest(
`Browser client is out of date, \
please refresh the page ("${versionHeader}" header was "${versionRequested}" but should be "${actualVersion}")`,
{ expected: actualVersion, got: versionRequested }
);
}

return h.continue;
Expand Down

0 comments on commit ac3aa28

Please sign in to comment.