Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

CodeSignal

Status Codes and Error Handling with FastAPI

via CodeSignal

Overview

Master error handling in FastAPI to build resilient applications. Implement custom error messages, leverage exception handlers, and create custom exceptions. This course equips you with the tools to ensure your API remains robust, informative, and user-friendly, even in error scenarios.

Syllabus

  • Lesson 1: Exploring Basic Status Codes
    • Running Status Code Tests
    • Simplifying Status Codes
    • Fixing Wrong Status Codes
    • Implement Basic Status Codes
    • Figuring Out the Status for PUT
  • Lesson 2: Using HTTPException for Error Handling
    • Error Handling in Action
    • Setting HTTPExceptions Codes
    • Handling the Delete Endpoint
  • Lesson 3: Handling General Exceptions with Exception Handlers
    • Test FastAPI Exception Handlers
    • Enhance Exception Handler Messages
    • Fix the FastAPI Exception Handler
    • Defining The Exception Handler
    • Write a General Exception Handler
  • Lesson 4: Handling Errors with Middleware
    • Middleware Error Handling in Practice
    • Middleware Error Handling with Details
    • Fix Your FastAPI Middleware
    • Completing the Error Handling Middleware
    • Write Middleware for Error Handling

Reviews

Start your review of Status Codes and Error Handling with FastAPI

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.