INNER CODE UNIT · Python
trigger_error
doganarif/fastapi-radar · example_app.py:278
async def trigger_error():
"""Example endpoint that raises an exception."""
# This will be captured in the Exceptions tab
raise ValueError("This is an example error for demonstration purposes")
@track_background_task(radar.get_session)
async def send_email_task(email: str, subject: str):
"""Simulated background task for sending emails."""
import asyncio
await asyncio.sleep(2) # Simulate email sending
return f"Email sent to {email}"
@track_background_task(radar.get_session)
async def process_report(user_id: int):
"""Simulated background task for processing reports."""