mirror of
https://github.com/Unleash/unleash.git
synced 2025-01-31 00:16:47 +01:00
f518b12b07
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.
22 lines
504 B
TypeScript
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: [],
|
|
},
|
|
],
|
|
};
|
|
}
|
|
}
|