From 61ccd42969128d5ef0b513f87004a5c3a7213c10 Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Fri, 27 Feb 2015 11:41:38 +0000 Subject: [PATCH] sometimes we have raygun errors without a message. make it easier to find them --- plugins/c9.error/raygun.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/plugins/c9.error/raygun.js b/plugins/c9.error/raygun.js index ee8b175d..28ed8441 100644 --- a/plugins/c9.error/raygun.js +++ b/plugins/c9.error/raygun.js @@ -29,6 +29,17 @@ function plugin(options, imports, register) { warning: new raygun.Client().init({ apiKey: options.keys.warning }) }; + for (var client in clients) { + client._send = client.send; + client.send = function(exception, customData, callback, request) { + var ex = exception; + if (!exception.stack) + ex = new Error(exception.message || exception); + + return this._send(ex, customData, callback, request); + }; + } + clients.error.setVersion(options.version + ".0"); clients.warning.setVersion(options.version + ".0");