Uploaded image for project: 'Couchbase node.js Client Library'
  1. Couchbase node.js Client Library
  2. JSCBC-329

Anti-pattern: try { doStuff() callback(); } catch (error) { callback(error); }

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 2.2.3
    • None
    • None
    • None

    Description

      When errors are thrown by the callback being invoked as can be seen here...

      https://github.com/couchbase/couchnode/blob/v2.2.2/lib/clustermgr.js#L160-L166

      ... the callback will be called again, with the error it threw. IMHO, user land callbacks should not be called from a try-block. As discussed on IRC with Brett.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            brett19 Brett Lawson
            ron.korving Ron Korving
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty