diff --git a/core/classifiers/create.js b/core/classifiers/create.js index 56de92663..e721b74a2 100644 --- a/core/classifiers/create.js +++ b/core/classifiers/create.js @@ -62,7 +62,12 @@ module.exports = async (req, res) => { // Get the classification ids for each output (or error if not found) const outputMappings = params.classificationValues.map(parseClassifierOutputMapping) - const serverIds = await getIds(outputMappings.map(value => value.to)) + let serverIds = {} + try { + serverIds = await getIds(outputMappings.map(value => value.to)) + } catch (_) { + throw new ValidationError(_.message) + } const outputs = outputMappings.map(value => ({ className: value.from, id: serverIds[value.to] })) const createdById = req.rfcx.auth_token_info.id