catch Meteor error on userLeaving
This commit is contained in:
parent
746ef9478c
commit
71d4e8b0e0
@ -28,8 +28,8 @@ export default function userLeaving(credentials, userId) {
|
||||
|
||||
const User = Users.findOne(selector);
|
||||
if (!User) {
|
||||
Logger.warn(`Could not find ${userId} in ${meetingId}: cannot complete userLeaving action`);
|
||||
return;
|
||||
throw new Meteor.Error(
|
||||
'user-not-found', `Could not find ${userId} in ${meetingId}: cannot complete userLeaving`);
|
||||
}
|
||||
|
||||
if (User.user.connection_status === OFFLINE_CONNECTION_STATUS) {
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { isAllowedTo } from '/imports/startup/server/userPermissions';
|
||||
import Logger from '/imports/startup/server/logger';
|
||||
|
||||
import userLeaving from './userLeaving';
|
||||
|
||||
@ -10,5 +11,10 @@ export default function userLogout(credentials) {
|
||||
|
||||
const { requesterUserId } = credentials;
|
||||
|
||||
return userLeaving(credentials, requesterUserId);
|
||||
try {
|
||||
userLeaving(credentials, requesterUserId);
|
||||
}
|
||||
catch(e) {
|
||||
Logger.error(`Exception while executing userLeaving: ${e}`);
|
||||
}
|
||||
};
|
||||
|
@ -40,7 +40,12 @@ Meteor.publish('users', function (credentials) {
|
||||
}
|
||||
|
||||
this.onStop(() => {
|
||||
userLeaving(credentials, requesterUserId);
|
||||
try {
|
||||
userLeaving(credentials, requesterUserId);
|
||||
}
|
||||
catch(e) {
|
||||
Logger.error(`Exception while executing userLeaving: ${e}`);
|
||||
}
|
||||
});
|
||||
|
||||
const selector = {
|
||||
|
Loading…
Reference in New Issue
Block a user