Commit 73249e0
authored
feat: improve InvalidIndexFile error to mention index file names (#1859)
* feat: improve InvalidIndexFile error to mention index file names
this makes it clearer which files are causing the link check to fail.
it also lets us customise the message in the special case of
`--index-files ''`, which could otherwise be confusing with a generic
message.
the messages are:
```
[ERROR] file:///h | Cannot find index file within directory: An index file (index.html) is required
[ERROR] file:///h | Cannot find index file within directory: An index file (index.html, or index.htm) is required
[ERROR] file:///h | Cannot find index file within directory: An index file (index.html, index.htm, or index.md) is required
```
and for the `--index-files ''` case:
```
[ERROR] file:///h | Cannot find index file within directory: No directory links are allowed because index_files is defined and empty
```
i do wonder if this last error message is still confusing because of the
"Cannot find index file within directory" text. maybe it should be
changed to a more general "Cannot resolve link to local directory"?
for comparison, the old message was always:
```
[ERROR] file:///h | Cannot find index file within directory: Index file not found in directory. Check if index.html or other index files exist
```
* move dropping into file.rs
* add some tests
* revert spurious1 parent 216d4bc commit 73249e0
3 files changed
+43
-10
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2546 | 2546 | | |
2547 | 2547 | | |
2548 | 2548 | | |
2549 | | - | |
| 2549 | + | |
2550 | 2550 | | |
2551 | 2551 | | |
2552 | | - | |
| 2552 | + | |
2553 | 2553 | | |
2554 | | - | |
| 2554 | + | |
2555 | 2555 | | |
2556 | 2556 | | |
2557 | 2557 | | |
| |||
2561 | 2561 | | |
2562 | 2562 | | |
2563 | 2563 | | |
| 2564 | + | |
2564 | 2565 | | |
| 2566 | + | |
| 2567 | + | |
| 2568 | + | |
| 2569 | + | |
| 2570 | + | |
| 2571 | + | |
| 2572 | + | |
| 2573 | + | |
| 2574 | + | |
| 2575 | + | |
2565 | 2576 | | |
2566 | 2577 | | |
2567 | 2578 | | |
| |||
2601 | 2612 | | |
2602 | 2613 | | |
2603 | 2614 | | |
2604 | | - | |
| 2615 | + | |
2605 | 2616 | | |
2606 | 2617 | | |
2607 | 2618 | | |
| |||
2610 | 2621 | | |
2611 | 2622 | | |
2612 | 2623 | | |
| 2624 | + | |
| 2625 | + | |
| 2626 | + | |
| 2627 | + | |
| 2628 | + | |
| 2629 | + | |
| 2630 | + | |
| 2631 | + | |
| 2632 | + | |
| 2633 | + | |
| 2634 | + | |
2613 | 2635 | | |
2614 | 2636 | | |
2615 | 2637 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
232 | 241 | | |
233 | 242 | | |
234 | 243 | | |
| |||
242 | 251 | | |
243 | 252 | | |
244 | 253 | | |
245 | | - | |
| 254 | + | |
246 | 255 | | |
247 | 256 | | |
248 | 257 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
73 | | - | |
| 73 | + | |
74 | 74 | | |
75 | | - | |
| 75 | + | |
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| |||
330 | 330 | | |
331 | 331 | | |
332 | 332 | | |
333 | | - | |
334 | | - | |
335 | | - | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
336 | 338 | | |
337 | 339 | | |
338 | 340 | | |
| |||
0 commit comments