Website: master edadb3e4

Author Committer Branch Timestamp Parent
dregad dregad master 2020-11-14 02:38 master f3585104
Changeset

Gracefully handle errors when retrieving tweets

In case the Twitter API call fails, get-tweets.php now returns the
status code in addition to the error details (JSON) in the response
body.

This allows the client to react properly to the error, as before it
would always get an HTTP 200 success status code and did not know that
something went wrong.

Adding a .fail() handler to the ajax call, displaying an error message;
the browser console should log the details about the failed XHR.

mod - get-tweets.php Diff File
mod - js/custom.js Diff File