Skip to content
This repository has been archived by the owner on Oct 10, 2022. It is now read-only.

Latest commit

 

History

History
15 lines (11 loc) · 484 Bytes

notfound.md

File metadata and controls

15 lines (11 loc) · 484 Bytes

Custom 404 error

Use createNotFoundError to throw custom error when resource is not returned by your detail implementation.

Since this error is likely the same throughout your application, consider using Crudella factory builder.

// dalmatianService.ts
import { createService } from 'crudella';
import { NotFound } from 'errors';

const dalmatianService = createService<DalmatianAttributes>({
    createNotFoundError: () => new NotFound(),
});