CodeYourFuture / CodeYourFuture/Full-Stack-Project-Assessment

Error handling for get videos

Đang mở
#469 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
🏝️ Priority Stretch 📅 Week 1 🔌 Backend
Ngôn ngữ chính
JavaScript
Star
9
Fork
352
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Bắt đầu từ endpoint GET /api/videos và theo dõi cách các lỗi kết nối cơ sở dữ liệu hiện đang được xử lý. Xác minh rằng cơ sở dữ liệu không khả dụng tạo ra HTTP 500 và cấu trúc lỗi JSON được chỉ định; hoàn thành khi cả hai tiêu chí nghiệm thu đều đạt.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
javascript
Lĩnh vực
api, backend, databases
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.