fhkahin / Full-Stack-Project-Assessment

https://full-stack-project-group2.netlify.app/
ISC License
1 stars 2 forks source link

Error handling for get videos #20

Open fhkahin opened 4 months ago

fhkahin commented 4 months ago

From Full-Stack-Project-Assessment created by Dedekind561: CodeYourFuture/Full-Stack-Project-Assessment#469

Description

You should design your system with error handling in mind. For example if the database cannot be accessed when you call GET /api/videos, then your backend endpoint should return a properly formatted error message with a HTTP 500 error code.

Acceptance criteria

Given a client calls the /api/videos endpoint, When the server cannot connect to the database , Then:

Here is an example JSON response:

{ "success": false, "error": "Could not connect to the database" }
HadikaMalik commented 3 months ago

https://github.com/fhkahin/Full-Stack-Project-Assessment/pull/31