Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

closeBecause is undefined #297

Closed
lholznagel opened this issue Nov 2, 2016 · 6 comments · Fixed by #298
Closed

closeBecause is undefined #297

lholznagel opened this issue Nov 2, 2016 · 6 comments · Fixed by #298

Comments

@lholznagel
Copy link

Hey,
when trying to close the amqp connection the following exception is thrown.

Unhandled Rejection: test/upload/processor.test.js
  TypeError: Cannot read property 'closeBecause' of undefined
    /home/travis/build/lholznagel/sfus-lib-cli/node_modules/amqplib/lib/channel_model.js:77:16
    Channel.C.close (/home/travis/build/lholznagel/sfus-lib-cli/node_modules/amqplib/lib/channel_model.js:76:18)
    processor.test.js:16:25
    reply (/home/travis/build/lholznagel/sfus-lib-cli/node_modules/amqplib/lib/channel.js:100:16)
    Channel.C.accept (/home/travis/build/lholznagel/sfus-lib-cli/node_modules/amqplib/lib/channel.js:433:12)
    Connection.mainAccept [as accept] (/home/travis/build/lholznagel/sfus-lib-cli/node_modules/amqplib/lib/connection.js:63:33)
    Socket.go (/home/travis/build/lholznagel/sfus-lib-cli/node_modules/amqplib/lib/connection.js:476:48)
    emitReadable_ (_stream_readable.js:432:10)
    emitReadable (_stream_readable.js:426:7)
    readableAddChunk (_stream_readable.js:187:13)
    Socket.Readable.push (_stream_readable.js:134:10)
    TCP.onread (net.js:551:20)
    From previous event:
        processor.test.js:15:14
        cleanAmqp (processor.test.js:13:12)
        processor.test.js:52:9
        process._tickCallback (internal/process/next_tick.js:103:7)

Exception was taken from travis build.

when running the whole thing with the old Version everything works fine.
When taking a look into the file where the exception is thrown the following line is showing up:

return this.closeBecause("Goodbye", defs.constants.REPLY_SUCCESS, cb);

I searched for closeBecause but only this line shows up as a result.

@nfantone
Copy link
Contributor

nfantone commented Nov 2, 2016

@lholznagel You are completely right. This one's on me, sorry. It's a bogus this reference.

This also goes to show that no unit test covers that particular line.

@nfantone
Copy link
Contributor

nfantone commented Nov 2, 2016

@lholznagel PR coming in a minute.

@lholznagel
Copy link
Author

Nice thanks!

@nfantone
Copy link
Contributor

nfantone commented Nov 2, 2016

☝️ There. Let's wait for @squaremo to review.

Apologies again.

@lholznagel
Copy link
Author

Nice.

Thanks to my tests nothing happened :)

@coffius
Copy link

coffius commented Nov 7, 2016

When will the fix be released?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants