diff --git a/docs/auth0/integration/fetchUserProfile.js b/docs/auth0/integration/fetchUserProfile.js index dafc9c9..285b34f 100644 --- a/docs/auth0/integration/fetchUserProfile.js +++ b/docs/auth0/integration/fetchUserProfile.js @@ -13,14 +13,14 @@ module.exports = function fetchUserProfile(accessToken, context, callback) { } if (resp.statusCode !== 200) { - return callback(new Error(body)); + return callback(new Error(`Unable to fetch user profile: non-success status ${resp.statusCode}`)); } let bodyParsed; try { bodyParsed = JSON.parse(body); } catch (jsonError) { - return callback(new Error(body)); + return callback(new Error('Unable to parse JSON body')); } const profile = {