Files
cfw-autumn/shared/api/errors/classes/featureErrClasses.ts
2026-06-15 14:40:15 +01:00

31 lines
756 B
TypeScript

import { RecaseError } from "../base/RecaseError.js";
import { FeatureErrorCode } from "../codes/featureErrCodes.js";
/**
* Product not found error
*/
export class FeatureAlreadyExistsError extends RecaseError {
constructor(opts: { featureId: string }) {
super({
message: `Feature ${opts.featureId} already exists`,
code: FeatureErrorCode.FeatureAlreadyExists,
statusCode: 409,
});
this.name = "FeatureAlreadyExistsError";
}
}
/**
* Feature not found error
*/
export class FeatureNotFoundError extends RecaseError {
constructor(opts: { featureId: string }) {
super({
message: `Feature ${opts.featureId} not found`,
code: FeatureErrorCode.FeatureNotFound,
statusCode: 404,
});
this.name = "FeatureNotFoundError";
}
}