Open maxceem opened 6 years ago
Currently, when errors happen during Bus API calls we don't get the actual error reason, but instead get Cannot read property 'data' of undefined, which doesn't have the information about the real error cause.
Cannot read property 'data' of undefined
The reason for this is that here https://github.com/topcoder-platform/tc-project-service/blob/dev/src/services/busApi.js#L27 we ignore all the errors happen during Bus API calls and resolve the promise without passing any information about error further.
So if some error during Bus API call happens we anyway go to the .then handler https://github.com/topcoder-platform/tc-project-service/blob/dev/src/services/busApi.js#L55 and after error happen due to the fact that we don't have resp defined on this line https://github.com/topcoder-platform/tc-project-service/blob/dev/src/services/busApi.js#L57. This error Cannot read property 'data' of undefined is later catched and logged here https://github.com/topcoder-platform/tc-project-service/blob/dev/src/services/busApi.js#L59.
.then
resp
Thanks @maxceem for capturing this.
Currently, when errors happen during Bus API calls we don't get the actual error reason, but instead get
Cannot read property 'data' of undefined
, which doesn't have the information about the real error cause.The reason for this is that here https://github.com/topcoder-platform/tc-project-service/blob/dev/src/services/busApi.js#L27 we ignore all the errors happen during Bus API calls and resolve the promise without passing any information about error further.
So if some error during Bus API call happens we anyway go to the
.then
handler https://github.com/topcoder-platform/tc-project-service/blob/dev/src/services/busApi.js#L55 and after error happen due to the fact that we don't haveresp
defined on this line https://github.com/topcoder-platform/tc-project-service/blob/dev/src/services/busApi.js#L57. This errorCannot read property 'data' of undefined
is later catched and logged here https://github.com/topcoder-platform/tc-project-service/blob/dev/src/services/busApi.js#L59.