SAUTO Network Programmability Foundation Practice Question
Which THREE of the following are valid methods within a Python script to handle potential errors when making API calls to a Cisco platform?
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
✓
Using a try-except block to catch 'requests.exceptions.RequestException'.
Robust API scripts must handle exceptions to prevent crashing and ensure logging of failures.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Using a try-except block to catch 'requests.exceptions.RequestException'.
Why this is correct
This catches all request-related errors gracefully.
- ✓
Using 'response.raise_for_status()' to raise an exception for 4xx/5xx HTTP errors.
Why this is correct
This method automatically triggers an exception for unsuccessful HTTP responses.
- ✗
Hardcoding a 60-second sleep timer after every API call to ensure the server is ready.
Why it's wrong here
This is inefficient and does not address actual error handling.
- ✗
Ignoring all exceptions to allow the script to continue running indefinitely.
Why it's wrong here
Ignoring errors hides failures and leads to inconsistent state.
- ✓
Checking the 'status_code' of the response object after the request.
Why this is correct
Verifying the HTTP status is a fundamental part of API error handling.
About these practice questions
This SAUTO question is part of Courseiva's 281-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed August 2026 · checked against the official Cisco exam blueprint
This SAUTO 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 SAUTO exam.