Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-417

Authenticate errors do not display error message when thrown

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.0.28
    • Affects Version/s: 2.0.25, 2.0.26
    • Component/s: None
    • Labels:
    • Environment:
      CentOS, Node v0.10.33

      When attempting to authenticate, if you throw the err that originates on an "auth failed" then the thrown error doesn't output the error message, instead it just says "Error" which makes the error basically useless.

      The example below shows that doing a console.log of the error shows that the error is of type MongoError with a message of "auth failed" but when you throw the error none of that information is displayed. This makes me think that the errors are originating with an awkward syntax that is throwing node's native behaviors off.

      var mongodb = require("mongodb");
      
      mongodb.MongoClient.connect("mongodb://192.168.50.5/client_rc", function(err, db) {
      	db.authenticate("bogus", "user", function(err) {
      		console.log("err", err);
      		throw err;
      	});
      });
      

            Assignee:
            christkv Christian Amor Kvalheim
            Reporter:
            owenallenaz Owen Allen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: