01 · Before and afterThe pattern
// before: catch-all around the whole flow
try { await cancelBooking(input) } catch (e) { if (isNotFound(e)) throw http404("Booking not found") ; throw e }
// after: catch only the lookup that defines "not found"
let booking;
try { booking = await getBooking(id) } catch (e) { if (isNotFound(e)) throw http404("Booking not found"); throw e }
await cancelBooking(booking); // later not-found errors keep their real meaning02 · Run it on your appThe check
Does each 404 in your API come from one specific lookup, not from a catch around the whole request?
If the honest answer is no or not sure, this is worth a look before it reaches production.