because I got bored of customising my CV for every job
1import { DomainError } from "./app-error";
2import { ConflictErrorCode } from "./error-codes";
3
4export class EntityAlreadyExistsError extends DomainError {
5 constructor(entityName: string, property: string, value: string) {
6 super(
7 ConflictErrorCode.ENTITY_ALREADY_EXISTS,
8 `${entityName} with this ${property} already exists`,
9 { entityName, property, value },
10 );
11 }
12}