Skip to content

Commit 5439f51

Browse files
don't swallow context in common error handling layer
1 parent 0b97d77 commit 5439f51

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

label_studio/fsm/api.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,9 @@ def post(self, request, *args, **kwargs):
182182
raise ValidationError({'detail': str(e)})
183183
except TransitionValidationError as e:
184184
# Explicit validation failure
185-
raise ValidationError({'detail': str(e), **(e.context or {})})
186-
185+
data = dict(e.context or {})
186+
data['non_field_errors'] = [str(e)]
187+
raise ValidationError(data)
187188
# Handle feature-flag disabled path (no state record created)
188189
if state_record is None:
189190
response_payload = {

0 commit comments

Comments
 (0)