UNPKG

lux-framework

Version:

Build scalable, Node.js-powered REST APIs with almost no code.

15 lines (12 loc) 443 B
// @flow import { createServerError } from '../../../server'; import stringify from '../../../../utils/stringify'; import typeof { Model } from '../../../database'; class RecordNotFoundError extends Error { constructor({ name, primaryKey }: Model, primaryKeyValue: mixed) { super( `Could not find ${name} with ${primaryKey} ${stringify(primaryKeyValue)}.` ); } } export default createServerError(RecordNotFoundError, 404);