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

docker-modem silently returns different output #69

Open
freefood89 opened this issue Oct 27, 2016 · 0 comments
Open

docker-modem silently returns different output #69

freefood89 opened this issue Oct 27, 2016 · 0 comments

Comments

@freefood89
Copy link

freefood89 commented Oct 27, 2016

Is there a specific reason behind silently supressing an error and returning a string instead of a parsed object as shown below?

https://github.com/apocas/docker-modem/blob/master/lib/modem.js#L199-L203

Modem.prototype.buildRequest = function(options, context, data, callback) {
    ....
    req.on('response', function(res) {
    ...
        try {
          json = JSON.parse(chunks);
        } catch (e) {
          json = chunks;
        }
    ...
})

I had a bunch of stopped containers and docker.listContainers({all: true}, ... ) broke silently.

If there's no reason, then I would like to submit a patch.

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

No branches or pull requests

1 participant