Something went wrong. Try again.
Something went wrong. Try again.
12345678910import {HTTPException} from 'hono/http-exception'
// the shared "first row or 404" guard for single-row selects and// returning() writesexport const firstOr404 = <T>(rows: T[], code = 'not_found'): T => { const [row] = rows if (!row) throw new HTTPException(404, {message: code}) return row}