mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-31 00:16:47 +01:00
21 lines
438 B
TypeScript
21 lines
438 B
TypeScript
|
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;
|