generator-kube-microservice-node
Version:
A k8s micro-service generator with deployment, service, Dockerfile. Built with express/mongo/redis
25 lines (20 loc) • 665 B
text/typescript
import GenericException from "./GenericException";
import { NOT_FOUND } from "http-status-codes";
export default class EntityNotFoundException extends GenericException {
constructor(idObject) {
const parseFields = (obj: { [param: string]: any }) => {
let string = '';
Object.entries(obj).forEach(el => {
string += `${el[0]}: ${el[1]}, `;
});
return string;
};
const params = {
name: 'EntityNotFoundException',
message: `Entity with values ${parseFields(idObject)}not found`,
statusCode: NOT_FOUND
};
super(params);
Object.setPrototypeOf(this, EntityNotFoundException.prototype);
}
}