mirror of https://github.com/zulip/zulip.git
Enable local browser error reporting if ZILENCER_ENABLED.
This commit is contained in:
parent
ba7ef1c82d
commit
95aee366c8
|
@ -275,9 +275,11 @@ class ErrorReporter(QueueProcessingWorker):
|
|||
|
||||
def consume(self, event):
|
||||
# type: (Mapping[str, Any]) -> None
|
||||
if not settings.DEPLOYMENT_ROLE_KEY:
|
||||
return
|
||||
self.staging_client.forward_error(event['type'], event['report'])
|
||||
if settings.DEPLOYMENT_ROLE_KEY:
|
||||
self.staging_client.forward_error(event['type'], event['report'])
|
||||
elif settings.ZILENCER_ENABLED:
|
||||
from zilencer.views import do_report_error
|
||||
do_report_error(settings.DEPLOYMENT_ROLE_NAME, event['type'], event['report'])
|
||||
|
||||
@assign_queue('slow_queries')
|
||||
class SlowQueryWorker(QueueProcessingWorker):
|
||||
|
|
|
@ -84,8 +84,12 @@ def submit_feedback(request, deployment, message=REQ(validator=check_dict([]))):
|
|||
|
||||
@has_request_variables
|
||||
def report_error(request, deployment, type=REQ(), report=REQ(validator=check_dict([]))):
|
||||
# type: (HttpRequest, Deployment, str, Dict[str, Any]) -> HttpResponse
|
||||
report['deployment'] = deployment.name
|
||||
# type: (HttpRequest, Deployment, text_type, Dict[str, Any]) -> HttpResponse
|
||||
return do_report_error(deployment.name, type, report)
|
||||
|
||||
def do_report_error(deployment_name, type, report):
|
||||
# type: (text_type, text_type, Dict[str, Any]) -> HttpResponse
|
||||
report['deployment'] = deployment_name
|
||||
if type == 'browser':
|
||||
notify_browser_error(report)
|
||||
elif type == 'server':
|
||||
|
|
Loading…
Reference in New Issue