Skip to content

Commit 3990d64

Browse files
author
Leandro Rosemberg
committed
Correcting the parsing of UploadError
1 parent 33572c2 commit 3990d64

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

roboflow/core/project.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,10 @@ def _annotation_params(self, annotation_path):
578578
return annotation_name, annotation_string
579579

580580
def _parse_upload_error(self, error: rfapi.UploadError) -> str:
581-
dict_part = str(error).split(": ", 2)[2]
581+
error_str = str(error)
582+
start_idx = error_str.index("{")
583+
end_idx = error_str.rindex("}") + 1
584+
dict_part = error_str[start_idx:end_idx]
582585
dict_part = dict_part.replace("True", "true")
583586
dict_part = dict_part.replace("False", "false")
584587
dict_part = dict_part.replace("None", "null")

0 commit comments

Comments
 (0)