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.
24 lines
626 B
JavaScript
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 |