Skip to content

412 Precondition Failed

The client set special conditions in its headers (like ‘only update if the file hasn’t changed’), and the condition wasn’t met.

Use this when a client sends an ‘If-Match’ header (saying ‘Only update this file if it hasn’t been edited since yesterday’), but someone else already edited it today.

import { HttpException, get } from 'shokupan';
export const getResource = get('/resource', () => {
throw new HttpException('Precondition Failed', 412);
});