1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-31 00:16:47 +01:00
unleash.unleash/src/lib/error/pattern-error.ts

21 lines
438 B
TypeScript
Raw Normal View History

import BadDataError from './bad-data-error';
import { ApiErrorSchema } from './unleash-error';
class PatternError extends BadDataError {
pattern: string;
constructor(message: string, pattern: string) {
super(message);
this.pattern = pattern;
}
toJSON(): ApiErrorSchema {
return {
...super.toJSON(),
pattern: this.pattern,
};
}
}
export default PatternError;