1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-20 00:08:02 +01:00
unleash.unleash/src/lib/error/minimum-one-environment-error.ts

24 lines
572 B
TypeScript
Raw Normal View History

2021-11-04 21:09:52 +01:00
class MinimumOneEnvironmentError extends Error {
constructor(message: string) {
super();
Error.captureStackTrace(this, this.constructor);
this.name = this.constructor.name;
this.message = message;
}
toJSON(): object {
return {
isJoi: true,
name: this.constructor.name,
details: [
{
message: this.message,
},
],
};
}
}
export default MinimumOneEnvironmentError;
module.exports = MinimumOneEnvironmentError;