cesium-ml / baselayer

Fully customizable (scientific, compute-intensive) web application template
http://cesium-ml.org/baselayer/
31 stars 18 forks source link

Return 404 rather than throw app error #344

Closed mcoughlin closed 1 year ago

mcoughlin commented 1 year ago

This PR returns 404 rather than throw app error in case of bad query.

See https://github.com/skyportal/skyportal/issues/3603

stefanv commented 1 year ago

The issue you linked to shows an error because the route sends you off to the wrong handler.

    (r'/api/sources(/.*)?', SourceHandler),

is presumably what is being matched as a route, and then the handler gets the source name and "comment" as arguments. Presumably, the better route would be:

    (r'/api/sources(/[^/]*)?', SourceHandler),
mcoughlin commented 1 year ago

@stefanv https://github.com/skyportal/skyportal/pull/3604 ok this seems better.