blueslip: Send the user agent string back with the error report

(imported from commit ed77877465b1497cd3d78753c3398329302075ff)
This commit is contained in:
Zev Benjamin 2013-03-15 17:30:07 -04:00
parent 53a68144e0
commit b08dbdfe48
2 changed files with 6 additions and 3 deletions

View File

@ -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;

View File

@ -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()