forked from postwait/node-amqp
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue postwait#445: Guard against unknown exchange name in queue.unbi…
…nd(). Do not touch this._bindings but execute the command against the connection anyway, assuming that the caller knows what they are doing.
- Loading branch information
Giso Deutschmann
committed
Jan 19, 2017
1 parent
ca2e3b5
commit acd53e9
Showing
2 changed files
with
37 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
var conn = require('./harness').createConnection(); | ||
|
||
var caughtError = false; | ||
|
||
var later = function(fun) { | ||
setTimeout(fun, 500); | ||
}; | ||
conn.once('ready', function () { | ||
puts("connected to " + conn.serverProperties.product); | ||
|
||
var q = conn.queue('node-simple-queue'); | ||
|
||
try { | ||
q.unbind('unknown-exchange', 'routing-key'); | ||
} catch(e) { | ||
caughtError = true; | ||
} | ||
|
||
later(function() { | ||
conn.end(); | ||
process.exit(); | ||
}); | ||
}); | ||
|
||
process.addListener('exit', function () { | ||
assert.equal(caughtError, false); | ||
}); |