subhramit commented on code in PR #73753:
URL: https://github.com/apache/airflow/pull/73753#discussion_r4111644888


##########
airflow-core/src/airflow/api_fastapi/core_api/routes/public/asset_state_store.py:
##########
@@ -172,13 +172,16 @@ def set_asset_state_store(
     session: SessionDep,
 ) -> None:
     """Set an asset state store value. Creates or overwrites the key."""
-    _get_db_backend().set_asset_state_store(
-        AssetScope(asset_id=asset_id),
-        key,
-        json.dumps(body.value),
-        kind=AssetStateStoreWriterKind.API,
-        session=session,
-    )
+    try:
+        _get_db_backend().set_asset_state_store(
+            AssetScope(asset_id=asset_id),
+            key,
+            json.dumps(body.value),
+            kind=AssetStateStoreWriterKind.API,
+            session=session,
+        )
+    except ValueError as e:
+        raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, 
detail=str(e)) from e

Review Comment:
   @Kaap10 https://dontpastetheai.com/



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to