> You’re free to subclass HTTPForbidden or just extend it.

But if I subclass HTTPForbidden, how do I get an instance of my subclass to be 
passed to the forbidden view (as request.exception) instead of the standard 
HTTPForbidden class? I thought it was Pyramid rather than user code that 
constructs that HTTPForbidden object.

> You can also 
> subclass Denied as you noted. The big question to me is whether you can 
> control the generation of that object to use the subclass and off the 
> top of my head I think it’s always done in user code right now if 
> you’re using the new SecurityPolicy interface but I could be wrong!

Yeah, this looks to me like it would work. I'll give it a try

> You 
> just have to program the forbidden view a little defensively or make a 
> separate one for your subclass so that you can still handle exceptions 
> generated from code you may not control. 

Yep, good tip

-- 
You received this message because you are subscribed to the Google Groups 
"pylons-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/4663be4d-4334-4c7d-b24e-1101866dd571%40www.fastmail.com.

Reply via email to