We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The message is returned to the user in the case of some kind of failure by the Tweet endpoint is incomplete.
The changes necessary would be on the order of:
try { tweetRequest = await request({ method: 'GET', url: `${twitterUrl.href}?${params.toString()}`, headers: {Authorization: `Bearer ${bearer}`}, }) } catch (error) { if (error.request) { - throw new Error('There seems to be a connection issue.') + if (error.response) { + let errorMessage = `Received status code ${error.response.status}.`; + if (error.response.data && error.response.data.errors) { + const errorDetails = error.response.data.errors.map(err => err.detail).join(', '); + errorMessage += ` Error details: ${errorDetails}`; + } + throw new Error(errorMessage); + } else { + throw new Error('No response received from the server. This may be a connection issue.'); + } } else { console.error(error) throw error } } const tweet: Tweet = JSON.parse(tweetRequest);
But I am not at this moment able to make and test the updated code.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The message is returned to the user in the case of some kind of failure by the Tweet endpoint is incomplete.
The changes necessary would be on the order of:
But I am not at this moment able to make and test the updated code.
The text was updated successfully, but these errors were encountered: