Skip to content
This repository was archived by the owner on Dec 23, 2024. It is now read-only.
This repository was archived by the owner on Dec 23, 2024. It is now read-only.

Show proper message if api request is forbidden (403 status) #6

Description

@devfake

It could be the case, that the API volume of Google Books is exhausted. The response will return a 403 status code.

I updated the backend and return this status to the client (0d65914).

What we need now is to display a message in the frontend. The best thing we can do is create a new variable, and set it to true if the response is a 403. And show a proper message in the template, similiar to the Nothing found :( span.

To test this, you can replace the line 24 in express.js instead of res.json(formattedData) with res.json(forbiddenResponse()).

Bonus point: Move the hardcodet status codes (404 for example) to own constants on top of the script (:

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions