Comparing version 0.4.0 to 0.4.1
# Change log for amqplib | ||
## Changes in v0.4.1 | ||
git log v0.4.0..v0.4.1 | ||
* Tested in Node.JS 0.8 through 4.2 and 5.5 | ||
* Emit an error with the 'close' event if server-initiated | ||
## Changes in v0.4.0 | ||
@@ -7,2 +14,3 @@ | ||
* Tested on Node.JS 0.8 through 4.0 (and intervening io.js releases) | ||
* Change meaning of 'b' fields in tables to match RabbitMQ (and AMQP | ||
@@ -9,0 +17,0 @@ specification) |
@@ -90,8 +90,8 @@ // | ||
var s = stackCapture(emsg); | ||
if (closeIsError(f.fields)) { | ||
var e = new Error(emsg); | ||
e.code = f.fields.replyCode; | ||
var e = new Error(emsg); | ||
e.code = f.fields.replyCode; | ||
if (isFatalError(e)) { | ||
connection.emit('error', e); | ||
} | ||
connection.toClosed(s, emsg); | ||
connection.toClosed(s, e); | ||
} | ||
@@ -354,3 +354,3 @@ else if (f.id === defs.ConnectionBlocked) { | ||
var s = stackCapture('Socket error'); | ||
this.toClosed(s, err.toString()); | ||
this.toClosed(s, err); | ||
} | ||
@@ -380,3 +380,3 @@ }; | ||
var s = stackCapture('ConnectionCloseOk received'); | ||
this.toClosed(s, 'Closed by client'); | ||
this.toClosed(s, undefined); | ||
} | ||
@@ -401,5 +401,6 @@ else if (f.id === defs.ConnectionClose) { | ||
// A close has been confirmed. Cease all communication. | ||
C.toClosed = function(capturedStack, msg) { | ||
C.toClosed = function(capturedStack, maybeErr) { | ||
this._closeChannels(capturedStack); | ||
var info = fmt('Connection closed (%s)', msg); | ||
var info = fmt('Connection closed (%s)', | ||
(maybeErr) ? maybeErr.toString() : 'by client'); | ||
// Tidy up, invalidate enverything, dynamite the bridges. | ||
@@ -415,3 +416,3 @@ invalidateSend(this, info, capturedStack); | ||
this.stream.end(); | ||
this.emit('close', msg); | ||
this.emit('close', maybeErr); | ||
}; | ||
@@ -429,5 +430,6 @@ | ||
hb.on('timeout', function() { | ||
self.emit('error', new Error("Heartbeat timeout")); | ||
var hberr = new Error("Heartbeat timeout"); | ||
self.emit('error', hberr); | ||
var s = stackCapture('Heartbeat timeout'); | ||
self.toClosed(s); | ||
self.toClosed(s, hberr); | ||
}); | ||
@@ -638,4 +640,4 @@ hb.on('beat', function() { | ||
function closeIsError(fields) { | ||
switch (fields.replyCode) { | ||
function isFatalError(error) { | ||
switch (error && error.code) { | ||
case defs.constants.CONNECTION_FORCED: | ||
@@ -650,1 +652,2 @@ case defs.constants.REPLY_SUCCESS: | ||
module.exports.Connection = Connection; | ||
module.exports.isFatalError = isFatalError; |
@@ -5,3 +5,3 @@ { | ||
"main": "./channel_api.js", | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"description": "An AMQP 0-9-1 (e.g., RabbitMQ) library and client.", | ||
@@ -13,3 +13,3 @@ "repository": { | ||
"engines": { | ||
"node": ">=0.8 <4 || ^4" | ||
"node": ">=0.8 <5 || ^5" | ||
}, | ||
@@ -16,0 +16,0 @@ "dependencies": { |
@@ -13,3 +13,4 @@ # AMQP 0-9-1 library and client for Node.JS | ||
A library for making AMQP 0-9-1 clients for Node.JS, and an AMQP 0-9-1 | ||
client for Node.JS v0.8, v0.9, v0.10, v0.11, v0.12, and io.js v1.x. | ||
client for Node.JS v0.8-12, v4.0, and the intervening io.js | ||
releases. | ||
@@ -144,3 +145,3 @@ This library does not implement [AMQP | ||
[gh-pages]: http://squaremo.github.com/amqp.node/ | ||
[gh-pages-apiref]: http://squaremo.github.com/amqp.node/doc/channel_api.html | ||
[gh-pages-apiref]: http://squaremo.github.com/amqp.node/channel_api.html | ||
[nave]: https://github.com/isaacs/nave | ||
@@ -147,0 +148,0 @@ [tutes]: https://github.com/squaremo/amqp.node/tree/master/examples/tutorials |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
358082
64
10567
149