Commit 90f624d
committed
filer: detect RESOURCE_ALREADY_EXISTS via message regex
The Workspace files import-file API returns
"<path> already exists. Please pass overwrite=true to overwrite it."
when a notebook already exists. The previous regex matched the older
"Path (<path>) already exists." format, so fs.ErrExist was no longer
returned, breaking TestImportDirDoesNotOverwrite and the 8
TestFilerWorkspaceNotebook subtests across every cloud.
Detect via the message regex rather than the error code, since the SDK
sometimes parses the body as raw text with an empty ErrorCode. Anchor
on the path token (\S+) to handle the "Request failed for ..." prefix
the SDK adds in that fallback path.
Co-authored-by: Isaac1 parent a3f0765 commit 90f624d
2 files changed
Lines changed: 1 addition & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
443 | 443 | | |
444 | 444 | | |
445 | 445 | | |
446 | | - | |
447 | 446 | | |
448 | 447 | | |
449 | 448 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
15 | 14 | | |
16 | 15 | | |
17 | 16 | | |
| |||
210 | 209 | | |
211 | 210 | | |
212 | 211 | | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
| 212 | + | |
222 | 213 | | |
223 | 214 | | |
224 | 215 | | |
| |||
0 commit comments