OLD | NEW |
1 # Copyright 2016 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 The Chromium Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 import base64 | 5 import base64 |
6 import json | 6 import json |
7 import logging | 7 import logging |
8 | 8 |
9 from common import constants | 9 from common import constants |
10 from common.base_handler import BaseHandler | 10 from common.base_handler import BaseHandler, Permission |
11 from common.base_handler import Permission | |
12 from crash import crash_pipeline | 11 from crash import crash_pipeline |
13 | 12 |
14 | 13 |
15 class CrashHandler(BaseHandler): | 14 class CrashHandler(BaseHandler): |
16 PERMISSION_LEVEL = Permission.ANYONE | 15 PERMISSION_LEVEL = Permission.ANYONE |
17 | 16 |
18 def HandlePost(self): | 17 def HandlePost(self): |
19 """Handles push delivery from Pub/Sub for crash data. | 18 """Handles push delivery from Pub/Sub for crash data. |
20 | 19 |
21 The crash data should be in the following json format: | 20 The crash data should be in the following json format: |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 crash_data['signature'], | 107 crash_data['signature'], |
109 crash_data['client_id'], | 108 crash_data['client_id'], |
110 crash_data['platform'], | 109 crash_data['platform'], |
111 crash_data['stack_trace'], | 110 crash_data['stack_trace'], |
112 crash_data['customized_data'], | 111 crash_data['customized_data'], |
113 queue_name=constants.CRASH_ANALYSIS_QUEUE[crash_data['client_id']]) | 112 queue_name=constants.CRASH_ANALYSIS_QUEUE[crash_data['client_id']]) |
114 except (KeyError, ValueError): # pragma: no cover. | 113 except (KeyError, ValueError): # pragma: no cover. |
115 # TODO: save exception in datastore and create a page to show them. | 114 # TODO: save exception in datastore and create a page to show them. |
116 logging.exception('Failed to process crash message') | 115 logging.exception('Failed to process crash message') |
117 logging.info(self.request.body) | 116 logging.info(self.request.body) |
OLD | NEW |