Commit 0032287
Use Exception#initialize hook for lazy loading
Load error enhancer gems on first exception creation by hooking
into Exception#initialize. This ensures gems are loaded before
detailed_message is called, so their prepended modules are
properly in the method chain. After loading, the overhead is
a single boolean check per exception creation.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 538c28b commit 0032287
1 file changed
Lines changed: 10 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
45 | 49 | | |
46 | 50 | | |
47 | 51 | | |
48 | | - | |
| 52 | + | |
49 | 53 | | |
0 commit comments