File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -5,6 +5,8 @@ All notable changes to this project will be documented in this file.
55The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ ) .
66
77## [ UNRELEASED]
8+ ### Fixed
9+ - stop ignoring exceptions with detail as an empty string when returning api errors.
810
911## [ 0.14.0] - 2024-06-19
1012### Added
Original file line number Diff line number Diff line change @@ -109,7 +109,7 @@ def flatten_errors(
109109 errors = []
110110 while fifo :
111111 detail , attr , index = fifo .pop (0 )
112- if not detail :
112+ if not detail and detail != "" :
113113 continue
114114 elif isinstance (detail , list ):
115115 for item in detail :
Original file line number Diff line number Diff line change @@ -118,3 +118,11 @@ def test_does_not_raise_recursion_error():
118118 "Failed due to a recursion error. Use an iterative approach rather than "
119119 "a recursive one to avoid reaching the maximum recursion depth in python."
120120 )
121+
122+
123+ def test_exception_with_detail_empty ():
124+ detail = {"some_field" : [ErrorDetail ("" , code = "invalid" )]}
125+ errors = flatten_errors (detail )
126+ assert len (errors ) == 1
127+ assert errors [0 ].attr == "some_field"
128+ assert errors [0 ].detail == ""
You can’t perform that action at this time.
0 commit comments