Repository navigation
Commit 464283d
fix(parse): improve error messages for malformed changesets
Fixes changesets#175
This PR improves the error handling and messages when parsing malformed
changeset files. The previous error messages were generic and didn't help
users understand what went wrong.
Changes:
- Add validation for empty changeset files with helpful example
- Improve error message when frontmatter is missing or invalid
- Add specific error for invalid YAML in frontmatter, including the YAML error
- Validate version types (major, minor, patch, none) with clear error message
- Validate package names are non-empty strings
- Include examples of correct format in error messages
- Add tests for all new error scenarios
The error messages now:
- Explain what went wrong
- Show what was received
- Provide an example of the correct format
Co-authored-by: Cursor <[email protected]>1 parent 10d13ae commit 464283d
2 files changed
Lines changed: 92 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
238 | | - | |
239 | | - | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
| 238 | + | |
245 | 239 | | |
246 | 240 | | |
247 | 241 | | |
| |||
252 | 246 | | |
253 | 247 | | |
254 | 248 | | |
255 | | - | |
256 | | - | |
257 | | - | |
258 | | - | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
259 | 283 | | |
260 | | - | |
261 | | - | |
| 284 | + | |
262 | 285 | | |
263 | 286 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
6 | 32 | | |
7 | 33 | | |
8 | 34 | | |
9 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
10 | 46 | | |
11 | 47 | | |
12 | 48 | | |
13 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
14 | 53 | | |
15 | 54 | | |
16 | 55 | | |
| |||
23 | 62 | | |
24 | 63 | | |
25 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
26 | 73 | | |
27 | 74 | | |
28 | 75 | | |
| |||
31 | 78 | | |
32 | 79 | | |
33 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
34 | 84 | | |
35 | | - | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
36 | 89 | | |
37 | 90 | | |
38 | 91 | | |
39 | | - | |
40 | | - | |
41 | | - | |
| 92 | + | |
42 | 93 | | |
43 | 94 | | |
44 | 95 | | |
0 commit comments