peertube-plugin-livechat/client/common/lib/models/validation.ts
John Livingston 45a63eaecd
Terms&Conditions (#18):
* new settings for instance's terms
* new channel option for channel's terms
2024-06-25 12:21:01 +02:00

23 lines
519 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: {[key: string]: ValidationErrorType[] } = {}
constructor (name: string, message: string | undefined, properties: ValidationError['properties']) {
super(message)
this.name = name
this.properties = properties
}
}