Get an empty GraphError with 200 code on 1.7.0
Bug Report
Prerequisites
- [x] Can you reproduce the problem?
- [x] Are you running the latest version?
- [x] Are you reporting to the correct repository?
- [x] Did you perform a cursory search?
For more information, see the CONTRIBUTING guide.
Description
[Description of the bug or feature] Got nearly empty GraphError with a 200 error code. Console Errors: [Is there any console error]
GraphError {
statusCode: 200,
code: null,
message: null,
requestId: null,
date: 2019-07-30T00:49:33.004Z,
body: null
}
Screenshots: [If applicable, add screenshots to help explain your problem]
Steps to Reproduce
Query an user's profile photo with user object id and credential get from client id and azure client secret and tenant name.
Expected behavior: [What you expected to happen]
A valid return result or valid GraphError that.
Actual behavior: [What actually happened]
Empty GraphError with 200 status code.
Additional context
How can I debug the code installed from npm with source map? It's nearly impossible to debug js code that compiled to ES6.
I'm also receiving this empty error when attempting to pull the users photo as a 'signed-in user'.
I'm using the below function where token is a valid OAuth token and the url is '/me/photo/$value':
const azureRequest = async (token, url) => {
const client = graph.Client.init({
authProvider: (done) => {
done(null, token);
},
});
try {
const result = await client
.api(url)
.get();
console.log(result);
return result;
} catch (err) {
console.error(err);
}
};
However, when removing the $value from the url and just pull the metadata, I'm able to pull it just fine.
{ '@odata.context':
'https: //graph.microsoft.com/v1.0/$metadata#users(\'{uid}\')/photo/$entity',
'@odata.mediaContentType': 'image/jpeg',
'@odata.mediaEtag': '"11FC69C2"',
id: '648X648',
height: 648,
width: 648
}
Seems like the issue referenced for this one has been closed, so closing this issue as well. Feel free to open the issue if needed.