Skip to content

Conversation

@julianstirling
Copy link
Contributor

  • Allows for both a dictionary or the configuration object to be passed to the fallback server.
  • Adds a try-except block to the server lifespan to check for things that error during __enter__ as this causes an error of SystemExit(3) with no traceback. Save the caught error to the server, before re-raising.
  • In the case of SystemExit(3), the fallback server extracts the caught error to give a useful traceback.

Closes #241

Before (but after #241 was fixed)

image

After

image

Copy link
Collaborator

@rwb27 rwb27 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a flake8 warning about some docstrings to fix, but otherwise I'm very happy to see this go in.

@barecheck
Copy link

barecheck bot commented Jan 9, 2026

Barecheck - Code coverage report

Total: 96.23%

Your code coverage diff: 0.06% ▴

Uncovered files and lines
FileLines
src/labthings_fastapi/server/__init__.py168, 329

@julianstirling
Copy link
Contributor Author

There's a flake8 warning about some docstrings to fix, but otherwise I'm very happy to see this go in.

Fixed those, also added a bit more testing.

@julianstirling julianstirling merged commit ced9008 into main Jan 9, 2026
14 checks passed
@julianstirling julianstirling deleted the fallback-bugfixes branch January 9, 2026 09:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fallback server errors rather than starting

3 participants