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

fix(run-v5): log displayer eventsource events #1020

Merged
merged 6 commits into from
Sep 7, 2018
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
better-ish
  • Loading branch information
RasPhilCo committed Sep 7, 2018
commit ccfb06482fc2adc8ea5e454373c9d9a21170935a
10 changes: 4 additions & 6 deletions packages/run-v5/lib/log_displayer.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,11 @@ function readLogsV2 (logplexURL) {
})

es.onerror = function (err) {
let msg = `Logs eventsource failed with: ${err.status} ${err.message}`

if (err && (err.status || err.message)) {
if (isTail && (err.status === 404 || err.status === 403)) {
msg = 'Log stream timed out. Please try again.'
}
reject(new Error(msg))
const msg = (isTail && (err.status === 404 || err.status === 403)) ?
'Log stream timed out. Please try again.' :
`Logs eventsource failed with: ${err.status} ${err.message}`
reject(msg)
es.close()
}

Expand Down