mirror of
https://github.com/overleaf/overleaf.git
synced 2025-04-09 05:16:02 +00:00
[SessionSockets] use a new MissingSessionError
This commit is contained in:
parent
6828becb46
commit
de518ea4eb
2 changed files with 9 additions and 1 deletions
|
@ -15,6 +15,12 @@ class DataTooLargeToParseError extends OError {
|
|||
}
|
||||
}
|
||||
|
||||
class MissingSessionError extends OError {
|
||||
constructor() {
|
||||
super('could not look up session by key')
|
||||
}
|
||||
}
|
||||
|
||||
class NullBytesInOpError extends OError {
|
||||
constructor(jsonChange) {
|
||||
super('null bytes found in op', { jsonChange })
|
||||
|
@ -30,6 +36,7 @@ class UpdateTooLargeError extends OError {
|
|||
module.exports = {
|
||||
CodedError,
|
||||
DataTooLargeToParseError,
|
||||
MissingSessionError,
|
||||
NullBytesInOpError,
|
||||
UpdateTooLargeError
|
||||
}
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
const { EventEmitter } = require('events')
|
||||
const { MissingSessionError } = require('./Errors')
|
||||
|
||||
module.exports = function (io, sessionStore, cookieParser, cookieName) {
|
||||
const missingSessionError = new Error('could not look up session by key')
|
||||
const missingSessionError = new MissingSessionError()
|
||||
|
||||
const sessionSockets = new EventEmitter()
|
||||
function next(error, socket, session) {
|
||||
|
|
Loading…
Add table
Reference in a new issue