Commit 1ed84e6
fix: add template validation for sablon 0.4.3 compatibility
Sablon 0.4.3 no longer raises Zip::Error for nonexistent template files,
instead returning an empty ZIP. This breaks the error handling in
CaseCourtReportsController that relies on catching Zip::Error to show
users a friendly "Template is not found" message.
Changes:
- Add file existence validation in CaseCourtReport#initialize
- Raise Zip::Error with descriptive message if template doesn't exist
- Update test to expect error during initialization (fail-fast approach)
- Maintain backward compatibility with existing error handling
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent cd9a51b commit 1ed84e6
File tree
2 files changed
+5
-2
lines changed- app/models
- spec/models
2 files changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
393 | 393 | | |
394 | 394 | | |
395 | 395 | | |
396 | | - | |
397 | | - | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
398 | 399 | | |
399 | 400 | | |
400 | 401 | | |
| |||
0 commit comments