As a consumer of the Properties Listing API, I want to receive informative error messages so that I can understand what went wrong when an API call fails and take corrective actions accordingly.
Acceptance Criteria
[ ] When the API receives an invalid request, it returns a 400 Bad Request status with a descriptive error message.
[ ] When a user tries to access a resource that doesn't exist, the API returns a 404 Not Found status with an appropriate message.
[ ] When the user is not authorized to perform an action, the API returns a 401 Unauthorized status with a clear message.
[ ] If the user is forbidden from accessing a resource, the API returns a 403 Forbidden status with an explanation.
[ ] When an internal server error occurs, the API returns a 500 Internal Server Error status with a generic error message.
[ ] The API provides a structured error response that contains a code, message, and any relevant details.
sequenceDiagram
participant Client
participant API
Client->>API: Request to list properties
API->>Client: Validating request
alt Request is invalid
API->>Client: Error 400 Bad Request
else Resource not found
API->>Client: Error 404 Not Found
else Unauthorized request
API->>Client: Error 401 Unauthorized
else Forbidden request
API->>Client: Error 403 Forbidden
else Internal server error
API->>Client: Error 500 Internal Server Error
end
API Error Handling
As a consumer of the Properties Listing API, I want to receive informative error messages so that I can understand what went wrong when an API call fails and take corrective actions accordingly.
Acceptance Criteria
400 Bad Request
status with a descriptive error message.404 Not Found
status with an appropriate message.401 Unauthorized
status with a clear message.403 Forbidden
status with an explanation.500 Internal Server Error
status with a generic error message.