1
0
mirror of https://github.com/Unleash/unleash.git synced 2024-10-18 20:09:08 +02:00
unleash.unleash/src/lib/error/project-without-owner-error.ts
Youssef d4521a1c0c fix: changeRole to assign roles without existing members
Co-authored-by: Christopher Kolstad <chriswk@getunleash.ai>
2022-03-03 14:33:32 +01:00

24 lines
579 B
TypeScript

export default class ProjectWithoutOwnerError extends Error {
constructor() {
super();
Error.captureStackTrace(this, this.constructor);
this.name = this.constructor.name;
this.message = 'A project must have at least one owner';
}
toJSON(): any {
const obj = {
isJoi: true,
name: this.constructor.name,
details: [
{
validationErrors: [],
message: this.message,
},
],
};
return obj;
}
}