javascript - Why this code throw "callback was already called" error? -


i have method inside call apis async.map() why calling callback inside request callback throw callback called? while works outside it?

  request_async (testcase, bodies, method, url, cb) {            async.map(bodies, (item, request_cb) => {                // request_cb(null, true) fine        if(item.values !== undefined ) {          const data = {            method: method,            uri: url,            formdata: item.values,            jar: this.jar          }            request(data, (err, response, body) => {            this.tests_count--            if (err)              throw(err)            testcase.compare(response.statuscode, body, item, url, function(message) {              console.log(message)              // request_cb(null, message) throw "callback called            });          });               }        }, (err, result) => {        console.log('after response', result)        cb(null, true)      })    }


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -