OLD | NEW |
(Empty) | |
| 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is govered by a BSD-style |
| 3 # license that can be found in the LICENSE file or at |
| 4 # https://developers.google.com/open-source/licenses/bsd |
| 5 |
| 6 """Page class for generating somewhat informative project-page 404s. |
| 7 |
| 8 This page class produces a mostly-empty project subpage, which helps |
| 9 users find what they're looking for, rather than telling them |
| 10 "404. That's an error. That's all we know." which is maddeningly not |
| 11 helpful when we already have a project pb loaded. |
| 12 """ |
| 13 |
| 14 from framework import monorailrequest |
| 15 from framework import servlet |
| 16 |
| 17 |
| 18 class ErrorPage(servlet.Servlet): |
| 19 """Page class for generating somewhat informative project-page 404s. |
| 20 |
| 21 This page class produces a mostly-empty project subpage, which helps |
| 22 users find what they're looking for, rather than telling them |
| 23 "404. That's an error. That's all we know." which is maddeningly not |
| 24 helpful when we already have a project pb loaded. |
| 25 """ |
| 26 |
| 27 _PAGE_TEMPLATE = 'sitewide/project-404-page.ezt' |
| 28 |
| 29 def get(self, **kwargs): |
| 30 servlet.Servlet.get(self, **kwargs) |
| 31 |
| 32 def GatherPageData(self, mr): |
| 33 """Build up a dictionary of data values to use when rendering the page.""" |
| 34 if not mr.project_name: |
| 35 raise monorailrequest.InputException('No project specified') |
| 36 return {} |
OLD | NEW |