Handling NotAuthorized exception from Authorization plugin

Hi,

Im trying to use a policy to allow access to certain users to a function. I have it working for the most part however i cannot find a way to handle the exception. I have follwed all the guids i can find but it still does not work. Ideally i would want to add a flash message that gives a message and then goto the login form.

please find my code here https://pastebin.com/u/mtbrandall/1/6BUNhp67