On Wed, 2013-03-06 at 13:37 +0000, Peter Waller wrote:
> On 6 March 2013 13:31, Malthe Borch <[email protected]> wrote:
>         But the solution is probably just awareness in this case. It's
>         unlikely that the interface will change. It's a "gotcha" :-).
> 
> 
> :(
> 
> 
> It's still not clear how (even with knowledge of this gotcha) I can
> easily debug it, actually. Since rather than throwing me to the
> console where I can look at a stack trace, I get a "not found".
> 
> 
> Can I just mandate that all of my resources must return None if they
> don't have a sub-resource instead? And then treat KeyError as an
> ordinary exception. How might I do that?
> 

You can replace the traverser.

http://docs.pylonsproject.org/projects/pyramid/en/1.4-branch/narr/hooks.html#changing-the-traverser

- C


> 
> It would mean I can't use a plain-old-dictionary, but I'm already waay
> past that point (of using something as simple as a dict) in my
> application anyway.
> 
> -- 
> 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 post to this group, send email to [email protected].
> Visit this group at
> http://groups.google.com/group/pylons-discuss?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  


-- 
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 post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to