File size: 784 Bytes
4327358
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import {
  NotImplementedException,
  UnprocessableEntityException,
} from '@nestjs/common';
import { getEngineName } from '@waha/config';

export const DOCS_URL = 'https://waha.devlike.pro/';

const engine = getEngineName();

export class NotImplementedByEngineError extends NotImplementedException {
  constructor(msg = '') {
    let error = `The method is not implemented by '${engine}' engine. Check the docs and try another engine: ${DOCS_URL}`;
    if (msg) {
      error = `${msg} ${error}`;
    }
    super(error);
  }
}

export class AvailableInPlusVersion extends UnprocessableEntityException {
  constructor(feature: string = 'The feature') {
    super(
      `${feature} is available only in Plus version for '${engine}' engine. Check this out: ${DOCS_URL}`,
    );
  }
}