<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Error-Handling on Ghafoor's Personal Blog</title><link>http://ghafoorsblog.com/tags/error-handling/</link><description>Recent content in Error-Handling on Ghafoor's Personal Blog</description><generator>Hugo</generator><language>en</language><managingEditor>noreply@example.com (AG Sayyed)</managingEditor><webMaster>noreply@example.com (AG Sayyed)</webMaster><copyright>Copyright © 2024-2026 AG Sayyed. All Rights Reserved.</copyright><lastBuildDate>Sat, 16 May 2026 17:42:12 +0100</lastBuildDate><atom:link href="http://ghafoorsblog.com/tags/error-handling/index.xml" rel="self" type="application/rss+xml"/><item><title>Debug With Try-Except</title><link>http://ghafoorsblog.com/courses/google/it-automation-content/it-automation-python-pcert/04-troubleshooting-debugging/04-module/004-with-try-catch/</link><pubDate>Thu, 13 Nov 2025 14:24:30 +0000</pubDate><author>noreply@example.com (AG Sayyed)</author><guid>http://ghafoorsblog.com/courses/google/it-automation-content/it-automation-python-pcert/04-troubleshooting-debugging/04-module/004-with-try-catch/</guid><description>&lt;p class="lead text-primary"&gt;
This document explores debugging Python programs using try-except blocks to handle runtime errors gracefully. Topics include catching specific exceptions, creating custom exceptions, using finally clauses, accessing exception details, and best practices for proper exception handling without swallowing errors.
&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="introduction"&gt;Introduction&lt;/h2&gt;
&lt;p&gt;Try-except (often called &amp;ldquo;try-catch&amp;rdquo; in other languages) is a common programming paradigm for handling runtime errors or exceptions gracefully without crashing programs. This mechanism allows developers to anticipate potential errors and respond appropriately, whether by logging the error, informing users, or attempting recovery actions.&lt;/p&gt;</description></item><item><title>Error Handling</title><link>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/08-ai-apps-python-flask/02-module/006-error-handling/</link><pubDate>Fri, 25 Jul 2025 00:00:00 +0000</pubDate><author>noreply@example.com (AG Sayyed)</author><guid>http://ghafoorsblog.com/courses/ibm/fullstack-content/fullstack-pcert/08-ai-apps-python-flask/02-module/006-error-handling/</guid><description>&lt;p class="lead text-primary"&gt;
This document covers HTTP status codes, error handling in Flask, and best practices for returning error responses from API endpoints. It explains status code categories, custom error responses, and application-level error handlers for robust API design.
&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id="understanding-http-status-codes"&gt;Understanding HTTP Status Codes&lt;/h2&gt;
&lt;p&gt;Every HTTP response includes a three-digit status code that indicates the result of the request. Status codes are grouped into categories:&lt;/p&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Code Range&lt;/th&gt;
 &lt;th&gt;Category&lt;/th&gt;
 &lt;th&gt;Description&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;100–199&lt;/td&gt;
 &lt;td&gt;Informational&lt;/td&gt;
 &lt;td&gt;Request received, continuing process&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;200–299&lt;/td&gt;
 &lt;td&gt;Success&lt;/td&gt;
 &lt;td&gt;Request received and processed successfully&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;300–399&lt;/td&gt;
 &lt;td&gt;Redirection&lt;/td&gt;
 &lt;td&gt;Further action needed to complete request&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;400–499&lt;/td&gt;
 &lt;td&gt;Client Error&lt;/td&gt;
 &lt;td&gt;Error in the request from the client&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;500–599&lt;/td&gt;
 &lt;td&gt;Server Error&lt;/td&gt;
 &lt;td&gt;Error on the server side&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Common codes include:&lt;/p&gt;</description></item></channel></rss>