Handle non-existant links #1

Closed
opened 2015-07-08 04:08:37 +00:00 by twodarek · 1 comment
twodarek commented 2015-07-08 04:08:37 +00:00 (Migrated from github.com)

Summary:
Handle non-existant links gracefully

Steps to repro:

  1. Go to http://go/test1 (assuming test1 doesn't exist)

Expected Result:
2. Redirected to the "Create New" page

Actual Outcome:
2. I see a rather nasty stack dump (below)

Traceback (most recent call last):
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1535, in __call__
    rv = self.handle_exception(request, response, e)
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1529, in __call__
    rv = self.router.dispatch(request, response)
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1278, in default_dispatcher
    return route.handler_adapter(request, response)
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1102, in __call__
    return handler.dispatch()
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 572, in dispatch
    return self.handle_exception(e, self.app.debug)
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 570, in dispatch
    return method(*args, **kwargs)
  File "/base/data/home/apps/s~kc8zpq-dev01/1.385561408714793377/guestbook.py", line 75, in get
    r = Redirect_Url.query(Redirect_Url.input_url == u'test').get().to_url
AttributeError: 'NoneType' object has no attribute 'to_url'
Summary: Handle non-existant links gracefully Steps to repro: 1. Go to http://go/test1 (assuming test1 doesn't exist) Expected Result: 2. Redirected to the "Create New" page Actual Outcome: 2. I see a rather nasty stack dump (below) ``` Traceback (most recent call last): File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1535, in __call__ rv = self.handle_exception(request, response, e) File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1529, in __call__ rv = self.router.dispatch(request, response) File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1278, in default_dispatcher return route.handler_adapter(request, response) File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 1102, in __call__ return handler.dispatch() File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 572, in dispatch return self.handle_exception(e, self.app.debug) File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/webapp2-2.5.2/webapp2.py", line 570, in dispatch return method(*args, **kwargs) File "/base/data/home/apps/s~kc8zpq-dev01/1.385561408714793377/guestbook.py", line 75, in get r = Redirect_Url.query(Redirect_Url.input_url == u'test').get().to_url AttributeError: 'NoneType' object has no attribute 'to_url' ```
twodarek commented 2015-07-08 04:22:47 +00:00 (Migrated from github.com)

PR #2 merged. Closing

PR #2 merged. Closing
Commenting is not possible because the repository is archived.
No milestone
No project
No assignees
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
twodarek/go-forwarder#1
No description provided.