/
githubmirror
/
novu
Обзор
Документация
Войти
/
githubmirror
/
novu
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
next
packages/framework/src/errors/platform.errors.ts
22 строки
579 B
Richard Fontein
feat(framework, web, application-generic): Propagate Bridge server errors to Bridge client (#6726)
21 окт 2024, 12:22
Не верифицирован
21 окт 2024, 12:22
fc5b3cb
Код
Авторство
О чём код?
import { ErrorCodeEnum, HttpStatusEnum } from '../constants'; export class PlatformError extends Error { /** * HTTP status code. */ public statusCode: HttpStatusEnum; /** * Additional data that can be used to provide more information about the error. */ public data: unknown; public code: ErrorCodeEnum; constructor(statusCode: HttpStatusEnum, code: string, message: string) { super(); this.data = { message }; this.statusCode = statusCode; this.code = code as ErrorCodeEnum; // TODO: replace with ErrorCode types from Platform. } }