Better error handling

This commit is contained in:
Adhiraj
2020-07-24 14:17:39 +05:30
parent d8d7e7dff8
commit db1f62f102
8 changed files with 43 additions and 45 deletions

View File

@@ -1,6 +1,19 @@
import { WA } from '../Binary/Constants'
import { proto } from '../../WAMessage/WAMessage'
export class BaileysError extends Error {
status?: number
context: any
constructor (message: string, context: any) {
super (message)
this.name = 'BaileysError'
this.status = context.status
this.context = context
}
}
export enum MessageLogLevel {
none=0,
info=1,