mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-03 22:29:01 +02:00
[SessionSockets] use a new MissingSessionError
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user