Handle, test and verify errors received from the response object (From the server side). Including file size error.
Possible errors from server side
500 Internal Server Error:
Message: "Failed to initialize database."
Cause: Thrown when there's an issue initializing the MongoDB connection.
500 Internal Server Error:
Message: "Server error"
Cause: General error during user addition (could be due to database insertion failures or other unexpected issues).
409 Conflict:
Message: "User already registered with this email or phone number"
Cause: When attempting to register a user that already exists in the database (checked by email or phone).
404 Not Found:
Message: "No users found"
Cause: When querying the users collection and no users are returned.
Handle, test and verify errors received from the response object (From the server side). Including file size error. Possible errors from server side
500 Internal Server Error: Message: "Failed to initialize database." Cause: Thrown when there's an issue initializing the MongoDB connection.
500 Internal Server Error: Message: "Server error" Cause: General error during user addition (could be due to database insertion failures or other unexpected issues).
409 Conflict: Message: "User already registered with this email or phone number" Cause: When attempting to register a user that already exists in the database (checked by email or phone).
404 Not Found: Message: "No users found" Cause: When querying the users collection and no users are returned.