17 lines
511 B
Python
17 lines
511 B
Python
"""Errors with a known execution boundary for MCP calculations."""
|
|
|
|
from fastapi import HTTPException
|
|
|
|
|
|
class CalculationCapacityExceeded(HTTPException):
|
|
"""Raised by admission control before the native function is invoked."""
|
|
|
|
code = "CALCULATION_CAPACITY_EXCEEDED"
|
|
|
|
def __init__(self) -> None:
|
|
super().__init__(
|
|
503,
|
|
"Calculation capacity is occupied; calculation not started. "
|
|
"Retry the same request after an active calculation finishes.",
|
|
)
|