[FIX] Remove stack traces from Meteor errors when debug setting is disabled (#22699)

* Remove stack traces from Meteor errors when debug setting is disabled

* Add missing changes to jitsiSetTimeout.js

Co-authored-by: pierre-lehnen-rc <55164754+pierre-lehnen-rc@users.noreply.github.com>
pull/22703/head^2
Matheus Barbosa Silva 5 years ago committed by GitHub
parent 81f5b52402
commit b96b062b09
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 7
      app/api/server/v1/misc.js
  2. 9
      app/api/server/v1/video-conference.js
  3. 4
      app/federation/server/normalizers/message.js
  4. 4
      app/videobridge/server/methods/jitsiSetTimeout.js

@ -15,6 +15,7 @@ import { API } from '../api';
import { getDefaultUserFields } from '../../../utils/server/functions/getDefaultUserFields';
import { getURL } from '../../../utils/lib/getURL';
import { StdOut } from '../../../logger/server/streamer';
import { SystemLogger } from '../../../logger/server';
// DEPRECATED
@ -271,8 +272,10 @@ const methodCall = () => ({
const result = Meteor.call(method, ...params);
return API.v1.success(mountResult({ id, result }));
} catch (error) {
Meteor._debug(`Exception while invoking method ${ method }`, error.stack);
SystemLogger.error(`Exception while invoking method ${ method }`, error.message);
if (settings.get('Log_Level') === '2') {
Meteor._debug(`Exception while invoking method ${ method }`, error.stack);
}
return API.v1.success(mountResult({ id, error }));
}
},

@ -15,8 +15,11 @@ API.v1.addRoute('video-conference/jitsi.update-timeout', { authRequired: true },
return API.v1.failure('Room does not exist!');
}
const jitsiTimeout = Meteor.runAsUser(this.userId, () => Meteor.call('jitsi:updateTimeout', roomId, Boolean(joiningNow)));
return API.v1.success({ jitsiTimeout });
try {
const jitsiTimeout = Meteor.runAsUser(this.userId, () => Meteor.call('jitsi:updateTimeout', roomId, Boolean(joiningNow)));
return API.v1.success({ jitsiTimeout });
} catch (error) {
return API.v1.failure(error.message);
}
},
});

@ -59,7 +59,7 @@ const normalizeMessage = (originalResource) => {
};
// Normalize mentions
for (const mention of resource.mentions) {
for (const mention of resource.mentions || []) {
// Ignore if we are dealing with all, here or rocket.cat
if (['all', 'here', 'rocket.cat'].indexOf(mention.username) !== -1) { continue; }
@ -73,7 +73,7 @@ const normalizeMessage = (originalResource) => {
}
// Normalize channels
for (const channel of resource.channels) {
for (const channel of resource.channels || []) {
if (!isFullyQualified(channel.name)) {
const originalUsername = channel.name;

@ -50,9 +50,9 @@ Meteor.methods({
return jitsiTimeout || nextTimeOut;
} catch (error) {
SystemLogger.error('Error starting video call:', error);
SystemLogger.error('Error starting video call:', error.message);
throw new Meteor.Error('error-starting-video-call', error.message);
throw new Meteor.Error('error-starting-video-call', error.message, { method: 'jitsi:updateTimeout' });
}
},
});

Loading…
Cancel
Save