From daf0d8ffdfbef9f1390db825e2c7c7b1cca60525 Mon Sep 17 00:00:00 2001 From: Morb0 Date: Wed, 6 Jan 2021 22:47:37 +0300 Subject: [PATCH] chore(telegraf-exception): remove message parsing --- lib/errors/telegraf.exception.ts | 25 +------------------------ 1 file changed, 1 insertion(+), 24 deletions(-) diff --git a/lib/errors/telegraf.exception.ts b/lib/errors/telegraf.exception.ts index 0e17137..f87e7fc 100644 --- a/lib/errors/telegraf.exception.ts +++ b/lib/errors/telegraf.exception.ts @@ -1,24 +1 @@ -import { isObject, isString } from '@nestjs/common/utils/shared.utils'; - -export class TelegrafException extends Error { - constructor(private readonly error: string | object) { - super(); - this.initMessage(); - } - - // TODO: Check real error format - public initMessage() { - if (isString(this.error)) { - this.message = this.error; - } else if ( - isObject(this.error) && - isString((this.error as Record).message) - ) { - this.message = (this.error as Record).message; - } else if (this.constructor) { - this.message = this.constructor.name - .match(/[A-Z][a-z]+|[0-9]+/g) - .join(' '); - } - } -} +export class TelegrafException extends Error {}