Skip to content

Commit

Permalink
fix: throw Meteor.Error instead of Error
Browse files Browse the repository at this point in the history
  • Loading branch information
Gustrb committed Oct 22, 2024
1 parent 04e7f06 commit c790f86
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/meteor/app/livechat/server/methods/takeInquiry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ export const takeInquiry = async (

const room = await LivechatRooms.findOneById(inquiry.rid);
if (!room || !(await Omnichannel.isWithinMACLimit(room))) {
throw new Error('error-mac-limit-reached');
throw new Meteor.Error('error-mac-limit-reached');
}

const contactId = await migrateVisitorIfMissingContact(inquiry.v._id, room.source);
if (contactId && (await shouldTriggerVerificationApp(contactId, room.source))) {
throw new Error('error-unverified-contact');
throw new Meteor.Error('error-unverified-contact');
}

const agent = {
Expand Down
1 change: 1 addition & 0 deletions packages/i18n/src/locales/en.i18n.json
Original file line number Diff line number Diff line change
Expand Up @@ -2183,6 +2183,7 @@
"error-max-number-simultaneous-chats-reached": "The maximum number of simultaneous chats per agent has been reached.",
"error-max-rooms-per-guest-reached": "The maximum number of rooms per guest has been reached.",
"error-mac-limit-reached": "The maximum number of monthly active contacts for this workspace has been reached.",
"error-unverified-contact": "The contact must be verified.",
"error-message-deleting-blocked": "Message deleting is blocked",
"error-message-editing-blocked": "Message editing is blocked",
"error-message-size-exceeded": "Message size exceeds Message_MaxAllowedSize",
Expand Down

0 comments on commit c790f86

Please sign in to comment.