Yggdrasil/errors/SessionError.js
azures04 80bca31d9a Add session server routes and SessionError class
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.
2025-12-24 02:35:04 +01:00

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