feat: indie status page MVP -- FastAPI + SQLite
- 8 DB models (services, incidents, monitors, subscribers, etc.) - Full CRUD API for services, incidents, monitors - Public status page with live data - Incident detail page with timeline - API key authentication - Uptime monitoring scheduler - 13 tests passing - TECHNICAL_DESIGN.md with full spec
This commit is contained in:
commit
902133edd3
4655 changed files with 1342691 additions and 0 deletions
32
venv/lib/python3.11/site-packages/mypyc/crash.py
Normal file
32
venv/lib/python3.11/site-packages/mypyc/crash.py
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
import traceback
|
||||
from collections.abc import Iterator
|
||||
from contextlib import contextmanager
|
||||
from typing import NoReturn
|
||||
|
||||
|
||||
@contextmanager
|
||||
def catch_errors(module_path: str, line: int) -> Iterator[None]:
|
||||
try:
|
||||
yield
|
||||
except Exception:
|
||||
crash_report(module_path, line)
|
||||
|
||||
|
||||
def crash_report(module_path: str, line: int) -> NoReturn:
|
||||
# Adapted from report_internal_error in mypy
|
||||
err = sys.exc_info()[1]
|
||||
tb = traceback.extract_stack()[:-4]
|
||||
# Excise all the traceback from the test runner
|
||||
for i, x in enumerate(tb):
|
||||
if x.name == "pytest_runtest_call":
|
||||
tb = tb[i + 1 :]
|
||||
break
|
||||
tb2 = traceback.extract_tb(sys.exc_info()[2])[1:]
|
||||
print("Traceback (most recent call last):")
|
||||
for s in traceback.format_list(tb + tb2):
|
||||
print(s.rstrip("\n"))
|
||||
print(f"{module_path}:{line}: {type(err).__name__}: {err}")
|
||||
raise SystemExit(2)
|
||||
Loading…
Add table
Add a link
Reference in a new issue