Repository navigation
Commit 4851e8d
committed
fix(rules): distinguish an absent rule directory from an unreadable one
`findRuleEngine`'s blanket `catch` read every `stat` failure as "not under
this engine". `EACCES` on a rule directory would therefore be reported as
absence, and `rule delete` would tell the user a rule that exists, and is
merely unreadable, was not found.
That is the same class of bug this function was added to fix, moved one
step: from "wrong engine assumed" to "real error misreported as absence".
`isMissingDirectory` exists for exactly this line and says so in its own doc
comment — `EACCES` above all is a real IO problem, and reading it as
"nothing here" is what makes an unreadable bucket indistinguishable from an
unwritten one. `dispatch.ts` already uses it. Now so does this.
Found by the review on #214.1 parent 1045c80 commit 4851e8d
2 files changed
Lines changed: 39 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
255 | 256 | | |
256 | 257 | | |
257 | 258 | | |
258 | | - | |
259 | | - | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
260 | 267 | | |
261 | 268 | | |
262 | 269 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
3 | 11 | | |
4 | 12 | | |
5 | | - | |
| 13 | + | |
6 | 14 | | |
7 | 15 | | |
8 | 16 | | |
| |||
259 | 267 | | |
260 | 268 | | |
261 | 269 | | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
262 | 290 | | |
263 | 291 | | |
264 | 292 | | |
| |||
0 commit comments