Skip to content

Commit

Permalink
unify error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
murtaza98 committed Apr 3, 2023
1 parent 00fc07c commit bef9d07
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/meteor/app/livechat/server/lib/Contacts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -80,15 +80,15 @@ export const Contacts = {
for await (const cf of allowedCF) {
if (!customFields.hasOwnProperty(cf._id)) {
if (cf.required) {
throw new Error(TAPi18n.__('error-required-custom-field-value', { field: cf.label }));
throw new Error(TAPi18n.__('error-invalid-custom-field-value', { field: cf.label }));
}
continue;
}
const cfValue: string | undefined = trim(customFields[cf._id] || '');

if (!cfValue || typeof cfValue !== 'string') {
if (cf.required) {
throw new Error(TAPi18n.__('error-req1-custom-field-value', { field: cf.label }));
throw new Error(TAPi18n.__('error-invalid-custom-field-value', { field: cf.label }));
}
continue;
}
Expand Down

0 comments on commit bef9d07

Please sign in to comment.