Chromium Code Reviews| Index: dashboard/dashboard/create_health_report.py |
| diff --git a/dashboard/dashboard/create_health_report.py b/dashboard/dashboard/create_health_report.py |
| index 4a1b175b61aef7650c671a88c7126be3519d5cdf..f699f85d8f2d5dcb9041e9720525305aa6bb772b 100644 |
| --- a/dashboard/dashboard/create_health_report.py |
| +++ b/dashboard/dashboard/create_health_report.py |
| @@ -4,6 +4,7 @@ |
| """Provides the web interface for adding and editing sheriff rotations.""" |
| +import logging |
| import json |
| from google.appengine.api import users |
| @@ -58,9 +59,17 @@ class CreateHealthReportHandler(request_handler.RequestHandler): |
| })) |
| return |
| - created_table, msg = table_config.CreateTableConfig( |
| - name=name, bots=master_bot, tests=tests, layout=table_layout, |
| - username=user.email()) |
| + try: |
| + created_table = table_config.CreateTableConfig( |
| + name=name, bots=master_bot, tests=tests, layout=table_layout, |
| + username=user.email()) |
| + except table_config.BadRequestError as error: |
| + self.response.out.write(json.dumps({ |
| + 'error': error.message, |
| + })) |
| + logging.error(error.message) |
| + return |
| + |
| if created_table: |
| self.response.out.write(json.dumps({ |
| @@ -68,7 +77,7 @@ class CreateHealthReportHandler(request_handler.RequestHandler): |
| })) |
| else: |
| self.response.out.write(json.dumps({ |
| - 'error': msg, |
| + 'error': 'Could not create table.', |
|
sullivan
2017/01/31 16:36:47
Should probably also log an error here. Imagine th
|
| })) |
| def _ValidateToken(self): |