Repository navigation
Commit ed2dce7
Mark client-generated results as synthetic (#211)
Step 3 of #6. The client returns a failed Result in three cases where no
HTTP error occurred:
processResponseGetOne 200 with an empty body -> code 404
processResponseGetOne 200 with a null body -> code 500
badRequestResult rejected before sending -> code 400
Those codes were indistinguishable from the same codes reported by Koios,
so a caller branching on getCode() could not tell a real 404 from "the
list came back empty", nor a real 400 from a request that never left the
client.
Adds Result.synthetic, true for exactly those three cases and false for
every result reflecting an actual HTTP response. The codes themselves are
unchanged, so existing callers keep working; the flag is there for callers
that need the distinction.
Co-authored-by: dudiedri <dudi.edri@ox.security>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>1 parent a29d132 commit ed2dce7
3 files changed
Lines changed: 39 additions & 3 deletions
File tree
- src
- main/java/rest/koios/client/backend/api/base
- test/java/rest/koios/client/backend/api/base
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
143 | 143 | | |
144 | | - | |
| 144 | + | |
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| |||
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
177 | | - | |
| 177 | + | |
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
26 | 40 | | |
27 | 41 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| 17 | + | |
15 | 18 | | |
16 | 19 | | |
17 | 20 | | |
| |||
49 | 52 | | |
50 | 53 | | |
51 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
52 | 68 | | |
53 | 69 | | |
54 | 70 | | |
| |||
60 | 76 | | |
61 | 77 | | |
62 | 78 | | |
| 79 | + | |
63 | 80 | | |
64 | 81 | | |
65 | 82 | | |
| |||
91 | 108 | | |
92 | 109 | | |
93 | 110 | | |
| 111 | + | |
94 | 112 | | |
95 | 113 | | |
96 | 114 | | |
| |||
110 | 128 | | |
111 | 129 | | |
112 | 130 | | |
| 131 | + | |
113 | 132 | | |
114 | 133 | | |
115 | 134 | | |
| |||
135 | 154 | | |
136 | 155 | | |
137 | 156 | | |
| 157 | + | |
138 | 158 | | |
| 159 | + | |
| 160 | + | |
139 | 161 | | |
140 | 162 | | |
141 | 163 | | |
| |||
0 commit comments