Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'master' of https://github.com/EqualMedia/node-amqp into…

… json_error
  • Loading branch information...
commit 5552e9b16ed9a12c273cf6c69c906f3e46479755 2 parents e25a980 + 9a05b7e
Theo Schlossnagle postwait authored

Showing 1 changed file with 7 additions and 1 deletion. Show diff stats Hide diff stats

  1. +7 1 amqp.js
8 amqp.js
@@ -1501,7 +1501,13 @@ Queue.prototype.subscribe = function (/* options, messageListener */) {
1501 1501 m.addListener('end', function () {
1502 1502 var json, deliveryInfo = {}, msgProperties = classes[60].fields;
1503 1503 if (isJSON) {
1504   - json = JSON.parse(b);
  1504 + try {
  1505 + json = JSON.parse(b);
  1506 + } catch (e) {
  1507 + json = null;
  1508 + deliveryInfo.parseError = e;
  1509 + deliveryInfo.rawData = b;
  1510 + }
1505 1511 } else {
1506 1512 json = { data: b, contentType: m.contentType };
1507 1513 }

0 comments on commit 5552e9b

Please sign in to comment.
Something went wrong with that request. Please try again.