[pylons-discuss] Is there a catch-all “predicate mismatch” view?

2019-08-07 Thread Jens Troeger
Hello,

During testing we just noticed that existing views whose predicate 
mismatched when making a request return an error like so:

404 Not Found
The resource could not be found.

predicate mismatch for view ... (request_method = POST)

Is there a way to define a view that matches any and all of such mismatches 
to avoid returning too much information to the client? At least for 
production…

Cheers!
Jens

-- 
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 pylons-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/78b7b977-8c47-481b-8488-21c223888a26%40googlegroups.com.


Re: [pylons-discuss] Is there a catch-all “predicate mismatch” view?

2019-08-08 Thread Michael Merickel
pyramid.exceptions.PredicateMismatch is a subclass of HTTPNotFound and thus
a generic 404 handler (notfound_view_config) will catch it. You can define
an exception_view_config specifically for PredicateMismatch if you wish to
be more specific but most people would let it fall through to the 404
handler which you apparently are not defining.

On Thu, Aug 8, 2019 at 1:16 AM Jens Troeger  wrote:

> Hello,
>
> During testing we just noticed that existing views whose predicate
> mismatched when making a request return an error like so:
>
> 404 Not Found
> The resource could not be found.
>
> predicate mismatch for view ... (request_method = POST)
>
> Is there a way to define a view that matches any and all of such
> mismatches to avoid returning too much information to the client? At least
> for production…
>
> Cheers!
> Jens
>
> --
> 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 pylons-discuss+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/pylons-discuss/78b7b977-8c47-481b-8488-21c223888a26%40googlegroups.com
> 
> .
>


-- 

Michael

-- 
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 pylons-discuss+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/pylons-discuss/CAKdhhwGKuU5nF%3D8edm6vEzUsztQDktVZ5v3Gq2EsnSFvRQq9zg%40mail.gmail.com.