Building Microservices API in Go - Assignment Solution: Fix GetAllCustomers API

Building Microservices API in Go - Assignment Solution: Fix GetAllCustomers API

Assessment

Interactive Video

Information Technology (IT), Architecture

University

Hard

Created by

Quizizz Content

FREE Resource

The video tutorial covers the process of updating an API to handle errors more effectively. It begins with changes in the domain, introducing a custom app error. The tutorial then moves to the database repository, addressing unexpected database errors. The service layer is updated to align with these changes, followed by modifications in the handlers. Testing is conducted to ensure the API returns JSON and handles errors correctly, including simulating a database failure. The tutorial concludes with a successful test, meeting all acceptance criteria.

Read more

5 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the primary change made to error handling in the domain and database repository?

Switching from app errors to generic errors

Introducing unexpected database errors

Removing all error handling

Using XML instead of JSON for errors

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In the service layer, what is the key change made to error handling?

Errors are now logged instead of being returned

Errors are ignored completely

Errors are replaced with app errors

Errors are converted to warnings

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of bringing the database down during testing?

To test the speed of the API

To check if the API can handle database errors correctly

To improve database performance

To reduce server load

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What status code does the API return in case of a successful operation?

404 Not Found

500 Internal Server Error

200 OK

403 Forbidden

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What format does the API use to return data after the changes?

XML

CSV

JSON

Plain Text