Commit 1054c19
committed
filer: restore INVALID_PARAMETER_VALUE branch (it does fire, with overwrite=true)
Previous commit (687c731) called the INVALID_PARAMETER_VALUE branch dead
code based on conflict scenarios that didn't pass overwrite=true. Re-probing
with overwrite=true (the mode bundle deploy uses) shows the server does
return 400 INVALID_PARAMETER_VALUE for cross-type collisions, in two
distinct message shapes:
"Cannot overwrite the asset at X due to type mismatch (asked: ..., actual: ...)"
"Requested node type [...] is different from the existing node type [...]"
Both fire only when the existing object's node type differs from the upload
(NOTEBOOK at /a/foo, regular-content overwrite-upload to /a/foo or /a/foo.py).
Without overwrite=true, the same scenario surfaces as RESOURCE_ALREADY_EXISTS
or ALREADY_EXISTS — which is why the no-overwrite probe missed this branch.
Restore the mapping (returning fileAlreadyExistsError so the caller's
errors.Is(err, fs.ErrExist) check still fires) and broaden the message
pattern from "Requested node type" to also match "type mismatch", so both
real-workspace messages are caught. Add unit tests for both shapes.
Co-authored-by: Isaac1 parent 687c731 commit 1054c19
2 files changed
Lines changed: 36 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
208 | 209 | | |
209 | 210 | | |
210 | 211 | | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
217 | 227 | | |
218 | 228 | | |
219 | 229 | | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
220 | 236 | | |
221 | 237 | | |
222 | 238 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
187 | 187 | | |
188 | 188 | | |
189 | 189 | | |
190 | | - | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | | - | |
| 190 | + | |
195 | 191 | | |
196 | | - | |
197 | | - | |
198 | | - | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
199 | 204 | | |
200 | 205 | | |
201 | 206 | | |
202 | 207 | | |
203 | | - | |
| 208 | + | |
204 | 209 | | |
205 | 210 | | |
206 | 211 | | |
| |||
0 commit comments