From b08dbdfe4804449d0eabdc428e7e9b007352e5f8 Mon Sep 17 00:00:00 2001 From: Zev Benjamin Date: Fri, 15 Mar 2013 17:30:07 -0400 Subject: [PATCH] blueslip: Send the user agent string back with the error report (imported from commit ed77877465b1497cd3d78753c3398329302075ff) --- zephyr/static/js/blueslip.js | 3 ++- zephyr/views.py | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/zephyr/static/js/blueslip.js b/zephyr/static/js/blueslip.js index ab030657e1..7a15b0f457 100644 --- a/zephyr/static/js/blueslip.js +++ b/zephyr/static/js/blueslip.js @@ -30,7 +30,8 @@ function report_error(msg, stack, opts) { type: 'POST', url: '/json/report_error', dataType: 'json', - data: { message: msg, stacktrace: stack }, + data: { message: msg, stacktrace: stack, + user_agent: window.navigator.userAgent}, timeout: 3*1000, success: function () { reported_errors[key] = true; diff --git a/zephyr/views.py b/zephyr/views.py index 43e0431cbe..78b8765e56 100644 --- a/zephyr/views.py +++ b/zephyr/views.py @@ -1442,7 +1442,9 @@ def json_get_active_statuses(request, user_profile): @authenticated_json_post_view @has_request_variables -def json_report_error(request, user_profile, message=POST, stacktrace=POST): +def json_report_error(request, user_profile, message=POST, stacktrace=POST, + user_agent=POST): mail_admins("Browser error for %s" % (user_profile.user.email,), - "Message:\n%s\n\nStacktrace:\n%s" % (message, stacktrace)) + "Message:\n%s\n\nStacktrace:\n%s\n\nUser agent:\n%s" + % (message, stacktrace, user_agent)) return json_success()