Yggdrasil/errors/SessionError.js
azures04 2519d8078a Refactor logger usage and add userRepository module
Replaces custom logger instantiation with a shared logger import across modules and routes. Moves player property and privilege management from authRepository to a new userRepository, expanding userRepository with additional user management functions (ban, unban, preferences, privileges, bans). Updates service and route files to use userRepository where appropriate. Adds new session join route and schema, and utility for UUID formatting.
2025-12-24 04:22:43 +01:00

24 lines
626 B
JavaScript

class SessionError extends Error {
constructor(statusCode, error, errorMessage, path) {
super(errorMessage)
this.path = path
this.error = error
this.statusCode = statusCode
this.errorMessage = errorMessage
this.isOperational = true
Error.captureStackTrace(this, this.constructor)
}
serialize() {
const response = {
path: this.path,
errorMessage: this.errorMessage
}
if (this.error != undefined) {
response.error = this.error
}
return response
}
}
module.exports = SessionError