Repository navigation
Commit def28d2
rfapi: extract error message from JSON body on non-2xx
Backend trash endpoints (DELETE /:ws/:project, DELETE /:ws/:project/:version,
DELETE /:ws/workflows/:url, GET /:ws/trash, POST /:ws/trash/restore) now
return proper 4xx/5xx HTTP status codes with `{"error": "..."}` JSON
bodies instead of 200 with an error tucked into the body. Update the
Python SDK to pull the `error` string out before raising RoboflowError
so users (and the CLI's error formatter) see a clean message instead
of the raw response body.
Falls back to response.text if the body isn't JSON or doesn't have an
`error` field, so non-trash endpoints (which still return raw text on
some failure paths) keep their existing behavior.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 2a97b6c commit def28d2
1 file changed
Lines changed: 22 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
855 | 855 | | |
856 | 856 | | |
857 | 857 | | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
858 | 875 | | |
859 | 876 | | |
860 | 877 | | |
| |||
865 | 882 | | |
866 | 883 | | |
867 | 884 | | |
868 | | - | |
| 885 | + | |
869 | 886 | | |
870 | 887 | | |
871 | 888 | | |
| |||
877 | 894 | | |
878 | 895 | | |
879 | 896 | | |
880 | | - | |
| 897 | + | |
881 | 898 | | |
882 | 899 | | |
883 | 900 | | |
| |||
888 | 905 | | |
889 | 906 | | |
890 | 907 | | |
891 | | - | |
| 908 | + | |
892 | 909 | | |
893 | 910 | | |
894 | 911 | | |
| |||
902 | 919 | | |
903 | 920 | | |
904 | 921 | | |
905 | | - | |
| 922 | + | |
906 | 923 | | |
907 | 924 | | |
908 | 925 | | |
| |||
918 | 935 | | |
919 | 936 | | |
920 | 937 | | |
921 | | - | |
| 938 | + | |
922 | 939 | | |
923 | 940 | | |
924 | 941 | | |
| |||
0 commit comments