diff --git a/.travis.yml b/.travis.yml index 18ae2d8..50a1d86 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ language: node_js node_js: + - "0.12" - "0.11" - "0.10" diff --git a/README.md b/README.md index e51af53..4c9cf53 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Raygun4Node +[![Build Status](https://travis-ci.org/MindscapeHQ/raygun4node.svg?branch=master)](https://travis-ci.org/MindscapeHQ/raygun4node) + Raygun.io plugin for Node ## Getting Started @@ -103,6 +105,7 @@ View a screencast on creating an app with Node.js and Express.js, then hooking u In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using "npm test". ## Release History +- 0.6.2 - Fix utf8 chars causing 400s, log when errors occur when posting - 0.6.1 - Replace deprecated request.host with request.hostname if it exists. - 0.6.0 - Added ability to send tags with exception reports. - 0.5.0 - Added filters for sensitive request data, and better affected user tracking diff --git a/lib/raygun.transport.js b/lib/raygun.transport.js index cf625c5..7989872 100644 --- a/lib/raygun.transport.js +++ b/lib/raygun.transport.js @@ -11,26 +11,30 @@ var http = require('https'); var send = function (options) { - var data = JSON.stringify(options.message); - var httpOptions = { - host: 'api.raygun.io', - port: 443, - path: '/entries', - method: 'POST', - headers: { - 'Content-Type': 'application/json', - 'Content-Length': data.length, - 'X-ApiKey': options.apiKey - } - }; - var request = http.request(httpOptions, function (response) { - if (options.callback) { - options.callback(response); - } - }); + try { + var data = new Buffer(JSON.stringify(options.message), 'utf8'); + var httpOptions = { + host: 'api.raygun.io', + port: 443, + path: '/entries', + method: 'POST', + headers: { + 'Content-Type': 'application/json', + 'Content-Length': data.length, + 'X-ApiKey': options.apiKey + } + }; + var request = http.request(httpOptions, function (response) { + if (options.callback) { + options.callback(response); + } + }); - request.write(data); - request.end(); + request.write(data); + request.end(); + } catch (e) { + console.log("Raygun: error " + e + " occurred while attempting to send error with message: " + options.message); + } }; exports.send = send; diff --git a/package.json b/package.json index e77a736..3420f78 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "raygun", "description": "Raygun.io plugin for Node", - "version": "0.6.1", + "version": "0.6.2", "homepage": "https://github.com/MindscapeHQ/raygun4node", "author": { "name": "MindscapeHQ",