1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-31 00:16:47 +01:00
unleash.unleash/src/lib/error/project-without-owner-error.ts
Thomas Heartman f518b12b07
chore!: [v6] remove error.description in error messages (#7157)
In preparation for v6, this PR removes usage and references to
`error.description` instead favoring `error.message` (as mentioned
#4380)

I found no references in the front end, so this might be (I believe it
to be) all the required changes.
2024-05-27 11:26:19 +02:00

22 lines
504 B
TypeScript

import { type ApiErrorSchema, UnleashError } from './unleash-error';
export default class ProjectWithoutOwnerError extends UnleashError {
statusCode = 409;
constructor() {
super('A project must have at least one owner');
}
toJSON(): ApiErrorSchema {
return {
...super.toJSON(),
details: [
{
message: this.message,
validationErrors: [],
},
],
};
}
}