Bird
0
0

A REST API returns inconsistent error formats like sometimes a string, sometimes an object. What is the main problem with this?

medium📝 Debug Q7 of 15
Rest API - Advanced Patterns
A REST API returns inconsistent error formats like sometimes a string, sometimes an object. What is the main problem with this?
AIt reduces server load
BIt improves flexibility for clients
CClients cannot reliably parse errors, causing bugs
DIt increases API speed
Step-by-Step Solution
Solution:
  1. Step 1: Understand error format consistency

    Consistent error formats help clients parse and handle errors reliably.
  2. Step 2: Analyze impact of inconsistency

    Inconsistent formats confuse clients, causing bugs and poor user experience.
  3. Final Answer:

    Clients cannot reliably parse errors, causing bugs -> Option C
  4. Quick Check:

    Consistent errors = reliable client parsing [OK]
Quick Trick: Keep error formats consistent for client reliability [OK]
Common Mistakes:
MISTAKES
  • Thinking inconsistency improves flexibility
  • Assuming it reduces load or speeds API

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Rest API Quizzes