Skip to content

Commit

Permalink
Refactors recommended by Zsolt implemented.
Browse files Browse the repository at this point in the history
  • Loading branch information
deathowl committed Dec 23, 2013
1 parent 717bd8e commit 9146601
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions config.js.example
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
{
proto : "https",
requirevalidcert : false //put here false if you use self signed certs. Ignored when proto is http
host :"YOUR ERRBIT HOST, OR api.airbrake.io FOR AIRBRAKE",
port : 80,
apiversion : 2, //Use API version 2 if you want to use Errbit
daemonport : 4135,
purgerinterval : 60,//in seconds
deprectiontime : 60,//Deprecation time of exception in seconds, use "disabled" to forward all errs.
log : {
backend : "stdout" // use syslog if you want to log to syslog
},
Expand Down
9 changes: 6 additions & 3 deletions lib/errorparser.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,13 @@ ErrorParser.prototype = {
var http = require("http");
} else {
var http = require("https");
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
if (!that.config.requirevalidcert) {
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
}
}

if((Date.now() - except.createdat) / 1000 < 60) {
var deprecationtime = that.config.deprecationtime;
if (deprecationtime == "disabled" ||
(Date.now() - except.createdat) / 1000 < deprecationtime) {
var req = http.request( postRequest, function( res ) {

res.statusCode;
Expand Down

0 comments on commit 9146601

Please sign in to comment.