Courseiva
hardMultiple SelectObjective-mapped

200-901 Practice Question: Which TWO of the following are valid ways to…

Which TWO of the following are valid ways to handle errors in a Python program that uses the Cisco Meraki API?

⚠ Common exam trap

Cisco often tests the distinction between handling errors via HTTP status codes versus parsing the response body for API-specific error fields, and the trap here is that candidates may think catching a generic Exception is sufficient, but the exam expects specific, layered error handling that respects both the HTTP protocol and the API's documented response format.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

Checking the response body for an 'errors' key and handling accordingly

The Cisco Meraki API commonly returns a JSON response body containing an 'errors' key when a request fails, even when the HTTP status code is not a traditional 4xx or 5xx. Checking this key allows the developer to extract specific error messages from the API, enabling precise handling of issues like invalid parameters or permission errors. This approach aligns with Meraki's documented error response format, where the 'errors' field provides an array of human-readable strings detailing what went wrong.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • Checking the response body for an 'errors' key and handling accordingly

    Why this is correct

    Many APIs, including Meraki, provide error details in the response body.

  • Checking the HTTP status code and raising an exception for 4xx and 5xx

    Why this is correct

    This allows specific handling of client and server errors.

  • Assuming the API always returns 200 and logging success

    Why it's wrong here

    This ignores error handling entirely.

  • Retrying the request indefinitely until success

    Why it's wrong here

    Indefinite retries can cause resource exhaustion and violate API rate limits.

  • Using a try-except block around the API call and catching generic Exception

    Why it's wrong here

    Catching generic Exception hides unexpected errors and is not recommended.

About these practice questions

One of 989 original 200-901 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This 200-901 practice question is part of Courseiva's free Cisco certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 200-901 exam.