Errors Across the Seam — Concept Check
Questions on Errors Across the Seam. A failure has to travel from a database constraint to a message a user understands, without losing the detail an engineer needs to diagnose it.
Questions in this quiz
8 questions on Errors Across the Seam — Concept Check. Work through them here, then start the quiz to answer them and see your score.
1.A user tries to register with an email that already exists in the database. What should the backend return?
- A200 with success message
- B422 with 'invalid_reference' code
- C500 with SQL error message
- D409 with 'email_taken' code
2.When a foreign key violation occurs, what is the appropriate response from the server?
- A500 with internal error message
- B200 with success message
- C404 with 'not_found' code
- D422 with 'invalid_reference' code
3.A user reports an error with a request ID. What is your first step in diagnosing the issue?
- AFind the server log line with the request ID
- BCheck the frontend code for issues
- CAsk the user to reproduce the error
- DVerify the user's account details
4.A client receives a 403 error. What should the UI display?
- A'You do not have access to this'
- B'Something went wrong'
- C'Please sign in again'
- D'That is no longer available'
5.What is a common mistake when handling errors across the seam?
- AProviding detailed error messages
- BReturning specific error codes
- CLogging request IDs
- DReturning generic 500 errors
6.If a client receives a 'rate_limited' error code, what should the UI suggest?
- ASign in again
- BTop up credits
- CWait and try again shortly
- DCheck the highlighted fields
7.In the context of error handling, what is the role of a request ID?
- ATo authenticate users
- BTo track session duration
- CTo store user preferences
- DTo correlate client and server logs
8.What should be logged server-side to aid in debugging without exposing sensitive information?
- ARequest ID, path, user ID, status
- BAll incoming requests in full
- CRequest body, headers, IP address
- DUser password, credit card details