Merge pull request +9655 from c9/report-error-dialog-errors

Report error dialog errors to raygun
This commit is contained in:
Tim Robinson 2015-09-30 17:57:29 +02:00
commit f8158a6522
3 changed files with 16 additions and 5 deletions

View File

@ -1,3 +1,8 @@
/**
* This error handler is for server side error logging.
*
**/
"use strict";
plugin.consumes = ["raygun"];

View File

@ -1,7 +1,7 @@
define(function(require, exports, module) {
"use strict";
main.consumes = ["Plugin", "ui", "metrics"];
main.consumes = ["Plugin", "ui", "metrics", "error_handler"];
main.provides = ["dialog.error"];
return main;
@ -9,6 +9,7 @@ define(function(require, exports, module) {
var Plugin = imports.Plugin;
var ui = imports.ui;
var metrics = imports.metrics;
var errorHandler = imports.error_handler;
/***** Initialization *****/
@ -114,14 +115,17 @@ define(function(require, exports, module) {
+ (message.className ? message.className : "");
if (!message.noError) {
metrics.increment("dialog.error");
if (!message) {
console.trace();
return console.error("empty error message", message);
}
console.error("Error dialog shown: ", getMessageString(message));
metrics.increment("dialog.error");
errorHandler.log(new Error("Error dialog shown"), {
message: message,
messageString: getMessageString(message),
});
}
hide(function() {

View File

@ -1,5 +1,7 @@
/**
* This error handler catches window.onerror and sends them to raygun.io
* This error handler is for client side error logging
* It also automatically catches window.onerror and sends them to raygun.io
* You can also import it and call .log to manually send an error
*
* @extends Plugin
* @singleton