CodeYourFuture / CodeYourFuture/Full-Stack-Project-Assessment

Error handling for get videos

Ouverte
#469 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
🏝️ Priority Stretch 📅 Week 1 🔌 Backend
Langage dominant
JavaScript
Étoiles
9
Forks
352
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

## 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_:
- [ ] The server should respond with a 500 status code
- [ ] The server should respond with a json object indicating the type of error

Here is an example JSON response:
```json
{ "success": false, "error": "Could not connect to the database" }
```

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.