CodeYourFuture / CodeYourFuture/Full-Stack-Project-Assessment

Error handling for get videos

未关闭
#469 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
🏝️ Priority Stretch 📅 Week 1 🔌 Backend
主要语言
JavaScript
星标
9
派生
352
PR 合并指标
30 天内没有已合并 PR

描述

## 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" }
```

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。