A better mindset: fail in a controlled way
The goal is not to eliminate every error, but to design safe responses.
An unhandled error can break a whole view. A controlled error can inform the user, log useful context and keep the surrounding state coherent.
Think in three layers: user message, developer log and system state after the failure.