chessGame / backend /util /errors.js
ilhamdev's picture
Upload folder using huggingface_hub
ece5841 verified
raw
history blame contribute delete
461 Bytes
class NotFoundError {
constructor(message) {
this.message = message;
this.status = 404;
}
}
class NotAuthError {
constructor(message) {
this.message = message;
this.status = 401;
}
}
function catchAsync(callback) {
return (req, res, next) => {
callback(req, res, next).catch(next);
};
}
exports.NotFoundError = NotFoundError;
exports.NotAuthError = NotAuthError;
exports.catchAsync = catchAsync