you want at least to catch Exception otherwise this will catch SystemExit.

also, can't we use a middleware for this instead?