File size: 787 Bytes
46252cd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import { UnprocessableEntityException } from '@nestjs/common';

/**
 * Thrown by an engine adapter when a chat-label write cannot be applied: either the account is not a
 * WhatsApp Business account (labels are a Business-only feature — whatsapp-web.js rejects the write with
 * an `[LT01] Only Whatsapp business` error) or the target chat type carries no labels (e.g. a channel).
 *
 * Extends NestJS `UnprocessableEntityException` so it maps to **HTTP 422** through NestJS's built-in
 * exception handler — no custom global filter required. Mirrors how {@link EngineNotReadyError} maps to 409.
 */
export class ChatLabelsUnsupportedError extends UnprocessableEntityException {
  constructor(message = 'Chat labels require a WhatsApp Business account.') {
    super(message);
  }
}