diff --git a/daras_ai_v2/base.py b/daras_ai_v2/base.py index b79968766..fba67cbc0 100644 --- a/daras_ai_v2/base.py +++ b/daras_ai_v2/base.py @@ -19,7 +19,7 @@ from fastapi import HTTPException from firebase_admin import auth from furl import furl -from pydantic import BaseModel, Field +from pydantic import BaseModel, Field, ValidationError from sentry_sdk.tracing import ( TRANSACTION_SOURCE_ROUTE, ) @@ -1583,6 +1583,10 @@ def on_submit(self): try: sr = self.create_new_run(enable_rate_limits=True) + except ValidationError as e: + st.session_state[StateKeys.run_status] = None + st.session_state[StateKeys.error_msg] = str(e) + return except RateLimitExceeded as e: st.session_state[StateKeys.run_status] = None st.session_state[StateKeys.error_msg] = e.detail.get("error", "")