NYPL / staff-picks

1 stars 3 forks source link

Adding endpoints accessed to error log message for troubleshooting. #217

Closed holingpoon closed 6 years ago

holingpoon commented 6 years ago

Sample log message:

{"timestamp":"2018-05-18T20:52:07.825Z","levelCode":3,"level":"ERROR","pid":"11066","message":"Status Code: 404, Error Message: staff-picks/2019-03 not found, Endpoint: /book-lists?type=staff-picks, Redirecting to: /books-music-movies/recommendations/best-books/404"}
ktp242 commented 6 years ago

Probably a larger issue this one. From what I found, if I used a incorrect endpoint at either of the calls that annualData.annualCurrentListData makes. It would not go int to catch, instead, it considered they were successful calls, and thus returned no error, instead of response with a message told me I did not provide correct OAuth secrets.

And then it will render either empty list for the dropdown menu or empty list of books.

screencapture-local-nypl-org-3001-books-music-movies-recommendations-best-books-ya-2018-05-18-17_12_28

screencapture-local-nypl-org-3001-books-music-movies-recommendations-best-books-ya-2018-05-18-17_17_02