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

Consolidating common session errors into one easier to read message. #1965

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
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
11 changes: 10 additions & 1 deletion lib/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ const plugins = require('../plugins/plugins')
const routes = require('../routes/api')
const { appDir, projectDir } = require('./paths')

let alreadyDisplayedSharedNameError = false

// Tweak the Markdown renderer
const defaultMarkedRenderer = marked.defaults.renderer || new marked.Renderer()

Expand Down Expand Up @@ -155,7 +157,7 @@ function matchRoutes (req, res, next) {
if (path === '') {
path = 'index'
}

renderPath(path, res, next)
}

Expand Down Expand Up @@ -211,6 +213,13 @@ function sessionFileStoreQuietLogFn (message) {
// but this isn't useful for our users, so let's just swallow those messages
return
}
if (message.startsWith('[session-file-store] will retry, error on last attempt')) {
if (!alreadyDisplayedSharedNameError) {
alreadyDisplayedSharedNameError = true
console.log('There was a problem loading session, this can happen with more than one prototype sharing a name. This shouldn\'t cause any further problems.')
}
return
}
console.log(message)
}

Expand Down