Bird
0
0

Find the mistake in this error response example:

medium📝 Debug Q7 of 15
Rest API - Error Handling

Find the mistake in this error response example:

{"status": "400", "error": "Bad Request", "message": 123}
ANo mistakes found
B"status" should be a number, not a string
C"error" should be a number, not a string
D"message" should be a string, not a number
Step-by-Step Solution
Solution:
  1. Step 1: Check the type of "message" field

    "message" should describe the error as a string, not a numeric code.
  2. Step 2: Verify other fields

    "status" as string is acceptable but ideally should be a number; "error" is correctly a string.
  3. Final Answer:

    "message" should be a string, not a number -> Option D
  4. Quick Check:

    Message field type = string [OK]
Quick Trick: Error messages must be strings [OK]
Common Mistakes:
  • Using numbers for message text
  • Confusing status code type
  • Assuming error can be numeric

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes