StaffCoder
FastAPI
FastAPIFastAPI 0.139Python 3.13
7 modules · 28 challengesSign up
Modules7 modules · 28 challenges
Learn how FastAPI reports what went wrong: raising a failure from deep inside a service and having it answered correctly, giving one kind of business failure its own reply in a single place, reshaping the framework's validation report into the service's own, and holding every refusal to one envelope.
Finish every challenge, or complete the star challenge, to complete the module.

Challenges

4 challenges

Domain HTTP Exceptions

Sign up to unlock
—No data yeteasy
About this challenge

This problem covers stopping a request from deep inside the service when the thing asked for is missing or off limits, so the caller gets the right status, a clear reason and a hint of who to ask.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

Custom Exception Handler

Sign up to unlock
0%0 of 1 solvedeasy
About this challenge

This problem covers giving one kind of business failure its own answer in a single place, so every endpoint that can hit it reports the same thing and no other failure is disturbed.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

Reshaped Validation Errors

Sign up to unlock
—No data yeteasy
About this challenge

This problem covers replacing the framework's account of what a caller got wrong with the service's own, naming each bad value by where it sits and keeping the reason it was refused.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

Payments Error Contract

STAR
Solving it completes the module
—No data yeteasy
About this challenge

This problem covers giving a payments service one way of reporting every refusal, so whatever went wrong and however deep it happened, a caller reads the same shape and can tell the causes apart.

Read the full problem
Solved in a browser IDE and graded by tests. Sign up to solve

We use cookies that are necessary to run Staffcoder, and optional analytics cookies to see which pages get used. Analytics stays off unless you accept. Read our Cookie Policy.