labthings / labthings/labthings-fastapi

Catch-all error handling for the web app

Open
#353 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
9
Forks
4
PR merge metrics
No merged PRs in 30d

Description

If an exception occurs somewhere it's not expected, it often results in an unpleasant stack trace that's not very helpful. #333 goes some way to addressing this, but it may be that a catch-all exception handler would result in a substantially improved user experience.

It would be good to explore whether we can add a catch-all exception handler that makes these error messages less confusing to someone new to LabThings, and gives a more helpful HTTP response. Ideally this would make the stack trace accessible for debugging, without obscuring the final message which ought to be along the lines of "LabThings has encountered an error, here's where you report a bug".

This is probably a separate issue from errors that originate in user code, which ought to be handled explicitly before they propagate outside of individual response handlers.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named. Start by reviewing issue #333 and locating the FastAPI application's exception-handling entry point, then reproduce an unexpected server exception and inspect the HTTP response. Done means unexpected errors produce a clearer response with debugging access while user-code errors remain handled explicitly.

Written by the indexing model from the issue text.

Assessment

Tech stack
fastapi, python
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.