cesium-ml / baselayer

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

Return 404 when requested resource not found/inaccessible #226

Closed acrellin closed 3 years ago

acrellin commented 3 years ago

Sure, that sounds good. Will update.

On Tue, May 4, 2021, 8:07 PM Stefan van der Walt @.***> wrote:

@.**** commented on this pull request.

In app/handlers/base.py https://github.com/cesium-ml/baselayer/pull/226#discussion_r626227652:

@@ -309,6 +309,8 @@ def error(self, message, data={}, status=400, extra={}): if not (status == 404 and self.request.method == "HEAD"): log(f'Error response returned by [{self.request.path}]: [{message}]')

  • if message.startswith("Access Error: Invalid"):

That's a very specific thing to catch and handle in a special way. Is this generic enough? Is there a way to make it more generic (such as raising an ObjectNotFound exception and handling that differently?).

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cesium-ml/baselayer/pull/226#discussion_r626227652, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABXFGTOPJSSDAT7WUD65243TMCY7BANCNFSM44DOXLPQ .

acrellin commented 3 years ago

@stefanv updated, ready for re-review

stefanv commented 3 years ago

I like it!