node-testrail-api icon indicating copy to clipboard operation
node-testrail-api copied to clipboard

callback is not a function

Open valentin-shipilov opened this issue 7 years ago • 7 comments

There is a error in the code: index.js line 90: callback(err.message || err) but this code branch executed when typeof callback !== 'function'

valentin-shipilov avatar Aug 07 '18 10:08 valentin-shipilov

I get this error on index.php?/api/v2/get_user_by_email&[email protected] Test Rail returns 404 with empty body when there is no user with such email

valentin-shipilov avatar Aug 07 '18 11:08 valentin-shipilov

same issue here: node_modules/testrail-api/index.js:90 return callback(err.message || err); ^ TypeError: callback is not a function

cenfun avatar Nov 05 '19 07:11 cenfun

Same issue here: TypeError: callback is not a function.

Will this be fixed soon?

vladimirparlik avatar Jan 17 '20 08:01 vladimirparlik

Same error here. Strange to call callback when it's not a function (there's already a if for that). @rundef what do you suggest in order for us to provide a PR. What is the expected behaviour? Thanks.

tvial-tagheuer avatar Mar 09 '20 18:03 tvial-tagheuer

Really sorry for the long wait guys ... @tvial-tagheuer Can you let me know if it's working with version 1.3.6 ? Thanks

rundef avatar Mar 09 '20 18:03 rundef

Hi @rundef, I tried but does not solve the issue. Message is :

Unhandled rejection (<{"message":"Unexpected token < in JSON...>, no stack trace)

err.message value is: Unexpected token < in JSON at position 0

The body being an HTML page with error 400.

tvial-tagheuer avatar Mar 10 '20 08:03 tvial-tagheuer

On a side note, you added rejectUnauthorized: false but you already had it.

https://github.com/rundef/node-testrail-api/blob/e09e446276c5ace050234b82fc60006dde6e6ee1/index.js#L47-L55

tvial-tagheuer avatar Mar 10 '20 08:03 tvial-tagheuer