jparis / qrs-interact

Inactive - QRS Interact is a simple javascript library that allows users to send queries to the Qlik Sense Repository Service.
GNU General Public License v3.0
10 stars 7 forks source link

qrs-interact methods do not reject on error #26

Closed goldbergjeffrey closed 7 years ago

goldbergjeffrey commented 8 years ago

Some paths in qrs-interact get rejected but have no error message sent back. Consequently, downstream errors occur but it's not known why.

example:

r.get(path)
                .on('response', function(response, body) {
                    sCode = response.statusCode;
                })
                .on('data', function(chunk) {

                    if (sCode == 200) {
                        res += chunk;
                    } else {
                        reject("Received error code: " + sCode);
                    }
                })
                .on('error', function(error) {
***rejection missing here***
                })
                .on('end', function() {
                    resolve(JSON.parse(res));
                });
jparis commented 7 years ago

Fixed.