11 lines
295 B
TypeScript
11 lines
295 B
TypeScript
|
|
import HttpError from "../interfaces/http-error";
|
||
|
|
import HttpStatus from "../interfaces/http-status";
|
||
|
|
|
||
|
|
export function throwRelationError(name: string) {
|
||
|
|
throw new HttpError(
|
||
|
|
HttpStatus.BAD_REQUEST,
|
||
|
|
`${name} cannot be found.`,
|
||
|
|
`relation${name.replaceAll(" ", "")}NotFound`,
|
||
|
|
);
|
||
|
|
}
|