Introduces new session server endpoints for hasJoined and profile lookup, adds a SessionError class for improved error handling, and updates error exports. Also renames sessionRepository and sessionService files to sessionsRepository and sessionsService for consistency, and sets max listeners in logger.
20 lines
503 B
JavaScript
20 lines
503 B
JavaScript
class SessionError extends Error {
|
|
constructor(statusCode, errorMessage, path) {
|
|
super(errorMessage)
|
|
this.path = path
|
|
this.statusCode = statusCode
|
|
this.errorMessage = errorMessage
|
|
this.isOperational = true
|
|
Error.captureStackTrace(this, this.constructor)
|
|
}
|
|
|
|
serialize() {
|
|
const response = {
|
|
path: this.path,
|
|
errorMessage: this.errorMessage
|
|
}
|
|
return response
|
|
}
|
|
}
|
|
|
|
module.exports = SessionError |