mirror of
https://github.com/linuxserver/core.git
synced 2026-02-20 05:07:19 +08:00
Add some more error metrics
This commit is contained in:
parent
dc8486a2da
commit
5fcf82f3e0
@ -1,11 +1,12 @@
|
||||
define(function(require, module, exports) {
|
||||
main.consumes = ["Dialog", "util", "dialog.alert"];
|
||||
main.consumes = ["Dialog", "util", "dialog.alert", "metrics"];
|
||||
main.provides = ["dialog.alert_internal"];
|
||||
return main;
|
||||
|
||||
function main(options, imports, register) {
|
||||
var Dialog = imports.Dialog;
|
||||
var util = imports.util;
|
||||
var metrics = imports.metrics;
|
||||
var alertWrapper = imports["dialog.alert"];
|
||||
|
||||
/***** Initialization *****/
|
||||
@ -25,6 +26,8 @@ define(function(require, module, exports) {
|
||||
/***** Methods *****/
|
||||
|
||||
function show(title, header, msg, onhide, options) {
|
||||
metrics.increment("dialog.error");
|
||||
|
||||
return plugin.queue(function(){
|
||||
if (header === undefined) {
|
||||
plugin.title = "Notice";
|
||||
|
||||
@ -1,13 +1,14 @@
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
main.consumes = ["Plugin", "ui"];
|
||||
main.consumes = ["Plugin", "ui", "metrics"];
|
||||
main.provides = ["dialog.error"];
|
||||
return main;
|
||||
|
||||
function main(options, imports, register) {
|
||||
var Plugin = imports.Plugin;
|
||||
var ui = imports.ui;
|
||||
var metrics = imports.metrics;
|
||||
|
||||
/***** Initialization *****/
|
||||
|
||||
@ -84,6 +85,8 @@ define(function(require, exports, module) {
|
||||
}
|
||||
|
||||
function show(message, timeout) {
|
||||
metrics.increment("dialog.error");
|
||||
|
||||
// Error message container
|
||||
if (!error) {
|
||||
error = document.body.appendChild(document.createElement("div"));
|
||||
|
||||
@ -8,7 +8,7 @@ define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
main.consumes = [
|
||||
"Plugin", "info"
|
||||
"Plugin", "info", "metrics"
|
||||
];
|
||||
main.provides = ["error_handler"];
|
||||
return main;
|
||||
@ -16,6 +16,7 @@ define(function(require, exports, module) {
|
||||
function main(options, imports, register) {
|
||||
var Plugin = imports.Plugin;
|
||||
var info = imports.info;
|
||||
var metrics = imports.metrics;
|
||||
|
||||
/***** Initialization *****/
|
||||
|
||||
@ -57,7 +58,8 @@ define(function(require, exports, module) {
|
||||
Raygun.setVersion(version + ".0");
|
||||
}
|
||||
|
||||
function reportError(exception, customData, tags) {
|
||||
function log(exception, customData, tags) {
|
||||
metrics.increment("errorhandler.log");
|
||||
if (typeof exception === "string")
|
||||
exception = new Error(exception);
|
||||
if (!exception)
|
||||
@ -78,8 +80,8 @@ define(function(require, exports, module) {
|
||||
|
||||
plugin.freezePublicAPI({
|
||||
/** @deprecated Use log() instead. */
|
||||
reportError: reportError,
|
||||
log: reportError
|
||||
reportError: log,
|
||||
log: log
|
||||
});
|
||||
|
||||
register(null, { "error_handler" : plugin });
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user