bigbluebutton-Github/bigbluebutton-html5/imports/api/audio-captions/server/handlers/transcriptionProviderError.js
2024-02-08 14:50:24 -03:00

39 lines
798 B
JavaScript

import Users from '/imports/api/users';
import Logger from '/imports/startup/server/logger';
export default async function handleTranscriptionProviderError({ header, body }) {
const {
meetingId,
userId,
} = header;
const selector = {
meetingId,
userId,
};
const {
errorCode,
errorMessage,
} = body;
const modifier = {
$set: {
transcriptionError: {
code: errorCode,
message: errorMessage,
},
},
};
try {
const numberAffected = await Users.updateAsync(selector, modifier);
if (numberAffected) {
Logger.error(`Transcription error errorCode=${errorCode} errorMessage=${errorMessage} meetingId=${meetingId}`);
}
} catch (err) {
Logger.error(`Problem setting transcription error: ${err}`);
}
}