Skip to content

Commit 9146601

Browse files
author
deathowl
committed
Refactors recommended by Zsolt implemented.
1 parent 717bd8e commit 9146601

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

config.js.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
{
22
proto : "https",
3+
requirevalidcert : false //put here false if you use self signed certs. Ignored when proto is http
34
host :"YOUR ERRBIT HOST, OR api.airbrake.io FOR AIRBRAKE",
45
port : 80,
56
apiversion : 2, //Use API version 2 if you want to use Errbit
67
daemonport : 4135,
78
purgerinterval : 60,//in seconds
9+
deprectiontime : 60,//Deprecation time of exception in seconds, use "disabled" to forward all errs.
810
log : {
911
backend : "stdout" // use syslog if you want to log to syslog
1012
},

lib/errorparser.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,13 @@ ErrorParser.prototype = {
4444
var http = require("http");
4545
} else {
4646
var http = require("https");
47-
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
47+
if (!that.config.requirevalidcert) {
48+
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
49+
}
4850
}
49-
50-
if((Date.now() - except.createdat) / 1000 < 60) {
51+
var deprecationtime = that.config.deprecationtime;
52+
if (deprecationtime == "disabled" ||
53+
(Date.now() - except.createdat) / 1000 < deprecationtime) {
5154
var req = http.request( postRequest, function( res ) {
5255

5356
res.statusCode;

0 commit comments

Comments
 (0)