Localised $@ to avoid previous exceptions causing template failures (e.g. when rendering the exception template)