peertube-plugin-livechat/client/common/lib/models/validation.ts
John Livingston c010758164
eslint 8.57 WIP:
* tweaking rules
* fixing issues
2024-09-09 18:47:21 +02:00

23 lines
517 B
TypeScript

// SPDX-FileCopyrightText: 2024 Mehdi Benadel <https://mehdibenadel.com>
//
// SPDX-License-Identifier: AGPL-3.0-only
export enum ValidationErrorType {
Missing,
WrongType,
WrongFormat,
NotInRange,
Duplicate,
TooLong
}
export class ValidationError extends Error {
properties: Record<string, ValidationErrorType[]> = {}
constructor (name: string, message: string | undefined, properties: ValidationError['properties']) {
super(message)
this.name = name
this.properties = properties
}
}